0s autopkgtest [06:56:17]: starting date and time: 2025-02-19 06:56:17+0000 0s autopkgtest [06:56:17]: git checkout: 325255d2 Merge branch 'pin-any-arch' into 'ubuntu/production' 0s autopkgtest [06:56:17]: host juju-7f2275-prod-proposed-migration-environment-15; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.pdeylbvh/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-ppc64el --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-15@bos03-ppc64el-13.secgroup --name adt-plucky-ppc64el-python-inline-snapshot-20250219-065617-juju-7f2275-prod-proposed-migration-environment-15-a8645ea4-e655-4bbe-9a27-285319e35bf9 --image adt/ubuntu-plucky-ppc64el-server --keyname testbed-juju-7f2275-prod-proposed-migration-environment-15 --net-id=net_prod-proposed-migration-ppc64el -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/ 99s autopkgtest [06:57:56]: testbed dpkg architecture: ppc64el 99s autopkgtest [06:57:56]: testbed apt version: 2.9.29 99s autopkgtest [06:57:56]: @@@@@@@@@@@@@@@@@@@@ test bed setup 100s autopkgtest [06:57:57]: testbed release detected to be: None 100s autopkgtest [06:57:57]: updating testbed package index (apt update) 101s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed InRelease [110 kB] 101s Hit:2 http://ftpmaster.internal/ubuntu plucky InRelease 101s Hit:3 http://ftpmaster.internal/ubuntu plucky-updates InRelease 101s Hit:4 http://ftpmaster.internal/ubuntu plucky-security InRelease 101s Get:5 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse Sources [14.6 kB] 101s Get:6 http://ftpmaster.internal/ubuntu plucky-proposed/universe Sources [770 kB] 101s Get:7 http://ftpmaster.internal/ubuntu plucky-proposed/main Sources [76.2 kB] 101s Get:8 http://ftpmaster.internal/ubuntu plucky-proposed/restricted Sources [3120 B] 101s Get:9 http://ftpmaster.internal/ubuntu plucky-proposed/main ppc64el Packages [95.3 kB] 101s Get:10 http://ftpmaster.internal/ubuntu plucky-proposed/restricted ppc64el Packages [760 B] 101s Get:11 http://ftpmaster.internal/ubuntu plucky-proposed/universe ppc64el Packages [666 kB] 101s Get:12 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse ppc64el Packages [6324 B] 102s Fetched 1742 kB in 1s (1708 kB/s) 103s Reading package lists... 103s + lsb_release --codename --short 103s + RELEASE=plucky 103s + cat 103s + [ plucky != trusty ] 103s + DEBIAN_FRONTEND=noninteractive eatmydata apt-get -y --allow-downgrades -o Dpkg::Options::=--force-confnew dist-upgrade 103s Reading package lists... 103s Building dependency tree... 103s Reading state information... 104s Calculating upgrade... 104s The following NEW packages will be installed: 104s libapt-pkg7.0 104s The following packages will be upgraded: 104s apt apt-utils dhcpcd-base rsyslog 104s 4 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. 104s Need to get 3731 kB of archives. 104s After this operation, 3926 kB of additional disk space will be used. 104s Get:1 http://ftpmaster.internal/ubuntu plucky/main ppc64el libapt-pkg7.0 ppc64el 2.9.30 [1152 kB] 105s Get:2 http://ftpmaster.internal/ubuntu plucky/main ppc64el apt ppc64el 2.9.30 [1439 kB] 105s Get:3 http://ftpmaster.internal/ubuntu plucky/main ppc64el apt-utils ppc64el 2.9.30 [228 kB] 105s Get:4 http://ftpmaster.internal/ubuntu plucky/main ppc64el dhcpcd-base ppc64el 1:10.1.0-7 [280 kB] 105s Get:5 http://ftpmaster.internal/ubuntu plucky/main ppc64el rsyslog ppc64el 8.2412.0-2ubuntu1 [632 kB] 105s Fetched 3731 kB in 1s (4857 kB/s) 105s Selecting previously unselected package libapt-pkg7.0:ppc64el. 106s (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 ... 106322 files and directories currently installed.) 106s Preparing to unpack .../libapt-pkg7.0_2.9.30_ppc64el.deb ... 106s Unpacking libapt-pkg7.0:ppc64el (2.9.30) ... 106s Setting up libapt-pkg7.0:ppc64el (2.9.30) ... 106s (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 ... 106371 files and directories currently installed.) 106s Preparing to unpack .../apt_2.9.30_ppc64el.deb ... 106s Unpacking apt (2.9.30) over (2.9.29) ... 106s Setting up apt (2.9.30) ... 107s (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 ... 106371 files and directories currently installed.) 107s Preparing to unpack .../apt-utils_2.9.30_ppc64el.deb ... 107s Unpacking apt-utils (2.9.30) over (2.9.29) ... 107s Preparing to unpack .../dhcpcd-base_1%3a10.1.0-7_ppc64el.deb ... 107s Unpacking dhcpcd-base (1:10.1.0-7) over (1:10.1.0-6) ... 107s Preparing to unpack .../rsyslog_8.2412.0-2ubuntu1_ppc64el.deb ... 108s Unpacking rsyslog (8.2412.0-2ubuntu1) over (8.2412.0-1ubuntu1) ... 108s Setting up apt-utils (2.9.30) ... 108s Setting up rsyslog (8.2412.0-2ubuntu1) ... 108s info: The user `syslog' is already a member of `adm'. 109s Setting up dhcpcd-base (1:10.1.0-7) ... 109s Processing triggers for man-db (2.13.0-1) ... 112s Processing triggers for libc-bin (2.40-4ubuntu1) ... 112s + rm /etc/apt/preferences.d/force-downgrade-to-release.pref 112s + /usr/lib/apt/apt-helper analyze-pattern ?true 112s + sed s/\./\\./g 112s + uname -r 112s + running_kernel_pattern=^linux-.*6\.12\.0-15-generic.* 112s + apt list ?obsolete 112s + tail -n+2 112s + cut -d/ -f1 112s + grep -v ^linux-.*6\.12\.0-15-generic.* 114s + true 114s + obsolete_pkgs= 114s + DEBIAN_FRONTEND=noninteractive eatmydata apt-get -y purge --autoremove 114s Reading package lists... 114s Building dependency tree... 114s Reading state information... 114s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 114s + grep -q trusty /etc/lsb-release 114s + [ ! -d /usr/share/doc/unattended-upgrades ] 114s + [ ! -d /usr/share/doc/lxd ] 114s + [ ! -d /usr/share/doc/lxd-client ] 114s + [ ! -d /usr/share/doc/snapd ] 114s + type iptables 114s + cat 114s + chmod 755 /etc/rc.local 114s + . /etc/rc.local 114s + iptables -w -t mangle -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu 114s + iptables -A OUTPUT -d 10.255.255.1/32 -p tcp -j DROP 114s + iptables -A OUTPUT -d 10.255.255.2/32 -p tcp -j DROP 114s + uname -m 114s + [ ppc64le = ppc64le ] 114s + systemctl is-active keyboard-setup.service 114s + [ active = failed ] 114s + [ -d /run/systemd/system ] 114s + systemd-detect-virt --quiet --vm 114s + mkdir -p /etc/systemd/system/systemd-random-seed.service.d/ 114s + cat 114s + grep -q lz4 /etc/initramfs-tools/initramfs.conf 114s + echo COMPRESS=lz4 114s autopkgtest [06:58:11]: upgrading testbed (apt dist-upgrade and autopurge) 114s Reading package lists... 115s Building dependency tree... 115s Reading state information... 115s Calculating upgrade...Starting pkgProblemResolver with broken count: 0 115s Starting 2 pkgProblemResolver with broken count: 0 115s Done 116s Entering ResolveByKeep 116s 116s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 116s Reading package lists... 116s Building dependency tree... 116s Reading state information... 117s Starting pkgProblemResolver with broken count: 0 117s Starting 2 pkgProblemResolver with broken count: 0 117s Done 117s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 117s autopkgtest [06:58:14]: rebooting testbed after setup commands that affected boot 151s autopkgtest-virt-ssh: WARNING: ssh connection failed. Retrying in 3 seconds... 162s autopkgtest [06:58:59]: testbed running kernel: Linux 6.12.0-15-generic #15-Ubuntu SMP Tue Feb 4 16:32:08 UTC 2025 164s autopkgtest [06:59:01]: @@@@@@@@@@@@@@@@@@@@ apt-source python-inline-snapshot 168s Get:1 http://ftpmaster.internal/ubuntu plucky/universe python-inline-snapshot 0.19.3-1 (dsc) [3233 B] 168s Get:2 http://ftpmaster.internal/ubuntu plucky/universe python-inline-snapshot 0.19.3-1 (tar) [87.9 kB] 168s Get:3 http://ftpmaster.internal/ubuntu plucky/universe python-inline-snapshot 0.19.3-1 (diff) [7508 B] 168s gpgv: Signature made Thu Jan 16 17:58:09 2025 UTC 168s gpgv: using RSA key FC875C834BC71FB6546250A86E25BF686AA7D62A 168s gpgv: issuer "katharasasikumar007@gmail.com" 168s gpgv: Can't check signature: No public key 168s dpkg-source: warning: cannot verify inline signature for ./python-inline-snapshot_0.19.3-1.dsc: no acceptable signature found 168s autopkgtest [06:59:04]: testing package python-inline-snapshot version 0.19.3-1 168s autopkgtest [06:59:05]: build not needed 169s autopkgtest [06:59:06]: test upstream-tests: preparing testbed 169s Reading package lists... 169s Building dependency tree... 169s Reading state information... 170s Starting pkgProblemResolver with broken count: 0 170s Starting 2 pkgProblemResolver with broken count: 0 170s Done 170s The following NEW packages will be installed: 170s black python-inline-snapshot-doc python3-all python3-annotated-types 170s python3-asttokens python3-click python3-dateutil python3-dirty-equals 170s python3-dnspython python3-email-validator python3-executing 170s python3-freezegun python3-hypothesis python3-iniconfig 170s python3-inline-snapshot python3-mypy-extensions python3-packaging 170s python3-pathspec python3-platformdirs python3-pluggy python3-pydantic 170s python3-pydantic-core python3-pytest python3-pytest-freezer 170s python3-pytest-mock python3-pytest-subtests python3-sortedcontainers 170s python3-time-machine python3.12 python3.12-minimal 170s 0 upgraded, 30 newly installed, 0 to remove and 0 not upgraded. 170s Need to get 8821 kB of archives. 170s After this operation, 48.1 MB of additional disk space will be used. 170s Get:1 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3.12-minimal ppc64el 3.12.9-1 [2465 kB] 171s Get:2 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3.12 ppc64el 3.12.9-1 [671 kB] 171s Get:3 http://ftpmaster.internal/ubuntu plucky-proposed/main ppc64el python3-click all 8.2.0-1 [81.9 kB] 171s Get:4 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-mypy-extensions all 1.0.0-1 [6148 B] 171s Get:5 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-packaging all 24.2-1 [51.5 kB] 171s Get:6 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-pathspec all 0.12.1-1 [24.5 kB] 171s Get:7 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-platformdirs all 4.3.6-1 [16.8 kB] 171s Get:8 http://ftpmaster.internal/ubuntu plucky/universe ppc64el black ppc64el 25.1.0-1 [1719 kB] 171s Get:9 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python-inline-snapshot-doc all 0.19.3-1 [541 kB] 171s Get:10 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-all ppc64el 3.13.1-1~exp2 [896 B] 171s Get:11 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-annotated-types all 0.7.0-1 [19.4 kB] 171s Get:12 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-asttokens all 3.0.0-1 [20.4 kB] 171s Get:13 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-dateutil all 2.9.0-3 [80.2 kB] 171s Get:14 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-dirty-equals all 0.9.0-1 [23.2 kB] 171s Get:15 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-dnspython all 2.7.0-1ubuntu1 [167 kB] 171s Get:16 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-email-validator all 2.2.0-1 [28.5 kB] 171s Get:17 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-executing all 2.2.0-0.1 [25.0 kB] 171s Get:18 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-freezegun all 1.5.1-1.2 [15.9 kB] 171s Get:19 http://ftpmaster.internal/ubuntu plucky/main ppc64el python3-sortedcontainers all 2.4.0-2 [27.6 kB] 171s Get:20 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-hypothesis all 6.125.2-1 [333 kB] 171s Get:21 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-iniconfig all 1.1.1-2 [6024 B] 171s Get:22 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-inline-snapshot all 0.19.3-1 [32.5 kB] 171s Get:23 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-pluggy all 1.5.0-1 [21.0 kB] 171s Get:24 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-pydantic-core ppc64el 2.27.2-1 [1852 kB] 171s Get:25 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-pydantic ppc64el 2.10.6-1 [288 kB] 171s Get:26 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-pytest all 8.3.4-1 [252 kB] 171s Get:27 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-pytest-freezer all 0.4.9-1 [4542 B] 171s Get:28 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-pytest-mock all 3.14.0-2 [11.7 kB] 171s Get:29 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-pytest-subtests all 0.13.1-1 [10.8 kB] 171s Get:30 http://ftpmaster.internal/ubuntu plucky/universe ppc64el python3-time-machine ppc64el 2.16.0-1 [25.0 kB] 172s Fetched 8821 kB in 1s (5957 kB/s) 172s Selecting previously unselected package python3.12-minimal. 172s (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 ... 106371 files and directories currently installed.) 172s Preparing to unpack .../00-python3.12-minimal_3.12.9-1_ppc64el.deb ... 172s Unpacking python3.12-minimal (3.12.9-1) ... 172s Selecting previously unselected package python3.12. 172s Preparing to unpack .../01-python3.12_3.12.9-1_ppc64el.deb ... 172s Unpacking python3.12 (3.12.9-1) ... 172s Selecting previously unselected package python3-click. 172s Preparing to unpack .../02-python3-click_8.2.0-1_all.deb ... 172s Unpacking python3-click (8.2.0-1) ... 172s Selecting previously unselected package python3-mypy-extensions. 172s Preparing to unpack .../03-python3-mypy-extensions_1.0.0-1_all.deb ... 172s Unpacking python3-mypy-extensions (1.0.0-1) ... 172s Selecting previously unselected package python3-packaging. 172s Preparing to unpack .../04-python3-packaging_24.2-1_all.deb ... 172s Unpacking python3-packaging (24.2-1) ... 172s Selecting previously unselected package python3-pathspec. 172s Preparing to unpack .../05-python3-pathspec_0.12.1-1_all.deb ... 172s Unpacking python3-pathspec (0.12.1-1) ... 172s Selecting previously unselected package python3-platformdirs. 172s Preparing to unpack .../06-python3-platformdirs_4.3.6-1_all.deb ... 172s Unpacking python3-platformdirs (4.3.6-1) ... 172s Selecting previously unselected package black. 172s Preparing to unpack .../07-black_25.1.0-1_ppc64el.deb ... 172s Unpacking black (25.1.0-1) ... 172s Selecting previously unselected package python-inline-snapshot-doc. 172s Preparing to unpack .../08-python-inline-snapshot-doc_0.19.3-1_all.deb ... 172s Unpacking python-inline-snapshot-doc (0.19.3-1) ... 173s Selecting previously unselected package python3-all. 173s Preparing to unpack .../09-python3-all_3.13.1-1~exp2_ppc64el.deb ... 173s Unpacking python3-all (3.13.1-1~exp2) ... 173s Selecting previously unselected package python3-annotated-types. 173s Preparing to unpack .../10-python3-annotated-types_0.7.0-1_all.deb ... 173s Unpacking python3-annotated-types (0.7.0-1) ... 173s Selecting previously unselected package python3-asttokens. 173s Preparing to unpack .../11-python3-asttokens_3.0.0-1_all.deb ... 173s Unpacking python3-asttokens (3.0.0-1) ... 173s Selecting previously unselected package python3-dateutil. 173s Preparing to unpack .../12-python3-dateutil_2.9.0-3_all.deb ... 173s Unpacking python3-dateutil (2.9.0-3) ... 173s Selecting previously unselected package python3-dirty-equals. 173s Preparing to unpack .../13-python3-dirty-equals_0.9.0-1_all.deb ... 173s Unpacking python3-dirty-equals (0.9.0-1) ... 173s Selecting previously unselected package python3-dnspython. 173s Preparing to unpack .../14-python3-dnspython_2.7.0-1ubuntu1_all.deb ... 173s Unpacking python3-dnspython (2.7.0-1ubuntu1) ... 173s Selecting previously unselected package python3-email-validator. 173s Preparing to unpack .../15-python3-email-validator_2.2.0-1_all.deb ... 173s Unpacking python3-email-validator (2.2.0-1) ... 173s Selecting previously unselected package python3-executing. 173s Preparing to unpack .../16-python3-executing_2.2.0-0.1_all.deb ... 173s Unpacking python3-executing (2.2.0-0.1) ... 173s Selecting previously unselected package python3-freezegun. 173s Preparing to unpack .../17-python3-freezegun_1.5.1-1.2_all.deb ... 173s Unpacking python3-freezegun (1.5.1-1.2) ... 173s Selecting previously unselected package python3-sortedcontainers. 173s Preparing to unpack .../18-python3-sortedcontainers_2.4.0-2_all.deb ... 173s Unpacking python3-sortedcontainers (2.4.0-2) ... 173s Selecting previously unselected package python3-hypothesis. 173s Preparing to unpack .../19-python3-hypothesis_6.125.2-1_all.deb ... 173s Unpacking python3-hypothesis (6.125.2-1) ... 173s Selecting previously unselected package python3-iniconfig. 173s Preparing to unpack .../20-python3-iniconfig_1.1.1-2_all.deb ... 173s Unpacking python3-iniconfig (1.1.1-2) ... 173s Selecting previously unselected package python3-inline-snapshot. 173s Preparing to unpack .../21-python3-inline-snapshot_0.19.3-1_all.deb ... 173s Unpacking python3-inline-snapshot (0.19.3-1) ... 173s Selecting previously unselected package python3-pluggy. 173s Preparing to unpack .../22-python3-pluggy_1.5.0-1_all.deb ... 173s Unpacking python3-pluggy (1.5.0-1) ... 173s Selecting previously unselected package python3-pydantic-core. 173s Preparing to unpack .../23-python3-pydantic-core_2.27.2-1_ppc64el.deb ... 173s Unpacking python3-pydantic-core (2.27.2-1) ... 173s Selecting previously unselected package python3-pydantic. 173s Preparing to unpack .../24-python3-pydantic_2.10.6-1_ppc64el.deb ... 173s Unpacking python3-pydantic (2.10.6-1) ... 173s Selecting previously unselected package python3-pytest. 173s Preparing to unpack .../25-python3-pytest_8.3.4-1_all.deb ... 173s Unpacking python3-pytest (8.3.4-1) ... 173s Selecting previously unselected package python3-pytest-freezer. 173s Preparing to unpack .../26-python3-pytest-freezer_0.4.9-1_all.deb ... 173s Unpacking python3-pytest-freezer (0.4.9-1) ... 173s Selecting previously unselected package python3-pytest-mock. 173s Preparing to unpack .../27-python3-pytest-mock_3.14.0-2_all.deb ... 173s Unpacking python3-pytest-mock (3.14.0-2) ... 173s Selecting previously unselected package python3-pytest-subtests. 173s Preparing to unpack .../28-python3-pytest-subtests_0.13.1-1_all.deb ... 173s Unpacking python3-pytest-subtests (0.13.1-1) ... 173s Selecting previously unselected package python3-time-machine. 173s Preparing to unpack .../29-python3-time-machine_2.16.0-1_ppc64el.deb ... 173s Unpacking python3-time-machine (2.16.0-1) ... 173s Setting up python3-iniconfig (1.1.1-2) ... 173s Setting up python3.12-minimal (3.12.9-1) ... 175s Setting up python3-pydantic-core (2.27.2-1) ... 175s Setting up python3-asttokens (3.0.0-1) ... 175s Setting up python3-mypy-extensions (1.0.0-1) ... 175s Setting up python3.12 (3.12.9-1) ... 177s Setting up python3-dirty-equals (0.9.0-1) ... 177s Setting up python3-all (3.13.1-1~exp2) ... 177s Setting up python3-sortedcontainers (2.4.0-2) ... 177s Setting up python3-click (8.2.0-1) ... 177s Setting up python3-annotated-types (0.7.0-1) ... 178s Setting up python3-platformdirs (4.3.6-1) ... 178s Setting up python3-packaging (24.2-1) ... 178s Setting up python3-executing (2.2.0-0.1) ... 178s Setting up python3-pluggy (1.5.0-1) ... 178s Setting up python3-dnspython (2.7.0-1ubuntu1) ... 179s Setting up python3-dateutil (2.9.0-3) ... 179s Setting up python3-email-validator (2.2.0-1) ... 180s Setting up python-inline-snapshot-doc (0.19.3-1) ... 180s Setting up python3-pathspec (0.12.1-1) ... 180s Setting up python3-freezegun (1.5.1-1.2) ... 180s Setting up python3-pytest (8.3.4-1) ... 181s Setting up python3-hypothesis (6.125.2-1) ... 182s Setting up black (25.1.0-1) ... 182s Setting up python3-time-machine (2.16.0-1) ... 182s Setting up python3-inline-snapshot (0.19.3-1) ... 182s Setting up python3-pydantic (2.10.6-1) ... 183s Setting up python3-pytest-freezer (0.4.9-1) ... 183s Setting up python3-pytest-mock (3.14.0-2) ... 184s Setting up python3-pytest-subtests (0.13.1-1) ... 184s Processing triggers for man-db (2.13.0-1) ... 185s Processing triggers for systemd (257.2-3ubuntu1) ... 186s autopkgtest [06:59:23]: test upstream-tests: [----------------------- 186s 186s *************************** 186s *** Testing with python3.12 186s *************************** 186s 186s Content of current working folder: 186s 186s total 12 186s drwxr-xr-x 3 ubuntu ubuntu 4096 Feb 19 06:59 . 186s drwxrwxrwt 5 root root 4096 Feb 19 06:59 .. 186s drwxrwxr-x 3 ubuntu ubuntu 4096 Jan 15 18:43 tests 186s Running tests... 186s 188s ============================= test session starts ============================== 188s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 188s rootdir: /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp 188s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 188s collected 392 items / 10 deselected / 382 selected 188s 195s tests/adapter/test_dataclass.py FFFFEFE.FF.F.FEFEFEFF [ 4%] 195s tests/adapter/test_dict.py F [ 4%] 196s tests/adapter/test_general.py F. [ 4%] 196s tests/adapter/test_sequence.py FF..F [ 6%] 196s tests/test_align.py . [ 6%] 196s tests/test_change.py F [ 6%] 198s tests/test_code_repr.py FF.FFFF.............................F [ 16%] 202s tests/test_config.py FEFEFEFE [ 17%] 202s tests/test_dirty_equals.py xF..F [ 18%] 202s tests/test_docs.py .s [ 19%] 203s tests/test_example.py FE [ 19%] 214s tests/test_external.py F..FFFFFFF..FFFF [ 23%] 217s tests/test_formating.py FF.. [ 24%] 217s tests/test_fstring.py .. [ 25%] 217s tests/test_hasrepr.py . [ 25%] 218s tests/test_inline_snapshot.py ..uuuuuuuuuuuuuuuuuuuuuuuuuuuuuu.,,,,,,,,, [ 26%] 221s ,,,,,,,,,,,,,,,,,,,,,.FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 39%] 224s FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF,,.,,.,,,.,,.,,., [ 55%] 224s ,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,, [ 61%] 224s .,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,. [ 67%] 224s ,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,.,, [ 73%] 224s ,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,,.,,. [ 79%] 225s ,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,.FFFFFFF...FF.FFFF..F [ 86%] 225s tests/test_is.py F [ 87%] 225s tests/test_is_normalized.py F [ 87%] 227s tests/test_preserve_values.py FFFFFFFFFFuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu [ 90%] 230s uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu,uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu [ 90%] 233s uuuuuuuuuuuuuuuuuuuuuuu,uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu [ 90%] 234s uuuuuuuuuuuuuuu,. [ 90%] 240s tests/test_pydantic.py FEFEFE.FE [ 91%] 241s tests/test_pypy.py F [ 91%] 262s tests/test_pytest_plugin.py .FFFFF.FFFFF.F.FFF..FFFE [ 97%] 262s tests/test_raises.py . [ 98%] 263s tests/test_rewrite_code.py .F [ 98%] 264s tests/test_string.py FFF. [ 99%] 265s tests/test_warns.py . [100%] 265s 265s ==================================== ERRORS ==================================== 265s ________________ ERROR at teardown of test_attrs_default_value _________________ 265s some snapshots in this test have incorrect values. 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot,Is 265s import attrs 265s 265s @attrs.define 265s class A: 265s a:int 265s b:int=2 265s c:list=attrs.field(factory=list) 265s d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) 265s 265s def test_something(): 265s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 265s assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) 265s 265s 265s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmpw3utt37y 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_something.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ________________________________ test_something ________________________________ 265s 265s def test_something(): 265s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 265s > assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) 265s 265s test_something.py:13: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:194: in assign 265s result_kwargs[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '2 ', filename = PosixPath('/tmp/tmpw3utt37y/test_something.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_something.py::test_something - TypeError: CliRunner.__init__() go... 265s ============================== 1 failed in 0.26s =============================== 265s 265s stderr: 265s 265s __________________ ERROR at teardown of test_attrs_field_repr __________________ 265s some snapshots in this test have incorrect values. 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot 265s import attrs 265s 265s @attrs.define 265s class container: 265s a: int 265s b: int = attrs.field(default=5,repr=False) 265s 265s assert container(a=1,b=5) == snapshot() 265s 265s 265s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmp3pm0viwm 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 0 items / 1 error 265s 265s ==================================== ERRORS ==================================== 265s ______________________ ERROR collecting test_something.py ______________________ 265s test_something.py:9: in 265s assert container(a=1,b=5) == snapshot() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 265s runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s ERROR test_something.py - TypeError: CliRunner.__init__() got an unexpected k... 265s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 265s =============================== 1 error in 0.35s =============================== 265s 265s stderr: 265s 265s _____________ ERROR at teardown of test_remove_positional_argument _____________ 265s some snapshots in this test have incorrect values. 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot 265s 265s from inline_snapshot._adapter.generic_call_adapter import GenericCallAdapter,Argument 265s 265s 265s class L: 265s def __init__(self,*l): 265s self.l=l 265s 265s def __eq__(self,other): 265s if not isinstance(other,L): 265s return NotImplemented 265s return other.l==self.l 265s 265s class LAdapter(GenericCallAdapter): 265s @classmethod 265s def check_type(cls, typ): 265s return issubclass(typ,L) 265s 265s @classmethod 265s def arguments(cls, value): 265s return ([Argument(x) for x in value.l],{}) 265s 265s @classmethod 265s def argument(cls, value, pos_or_name): 265s assert isinstance(pos_or_name,int) 265s return value.l[pos_or_name] 265s 265s def test_L1(): 265s assert L(1,2) == snapshot(L(1)), "not equal" 265s 265s def test_L2(): 265s assert L(1,2) == snapshot(L(1, 2, 3)), "not equal" 265s 265s 265s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmp2ui3c5s9 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 2 items 265s 265s test_something.py F. [100%] 265s 265s =================================== FAILURES =================================== 265s ___________________________________ test_L1 ____________________________________ 265s 265s def test_L1(): 265s > assert L(1,2) == snapshot(L(1)), "not equal" 265s 265s test_something.py:30: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:162: in assign 265s new_code=self.context.file._value_to_code(value.value), 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '2 ', filename = PosixPath('/tmp/tmp2ui3c5s9/test_something.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s ──────────────────────────────── Fix snapshots ───────────────────────────────── 265s =========================== short test summary info ============================ 265s FAILED test_something.py::test_L1 - TypeError: CliRunner.__init__() got an un... 265s 265s stderr: 265s Traceback (most recent call last): 265s File "", line 198, in _run_module_as_main 265s File "", line 88, in _run_code 265s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 265s raise SystemExit(pytest.console_main()) 265s ^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 265s code = main() 265s ^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 265s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 265s return wrap_session(config, _main) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 265s config.hook.pytest_sessionfinish( 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 265s teardown.send(result) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 265s self.config.hook.pytest_terminal_summary( 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary 265s diff = file.diff() 265s ^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff 265s unified_diff(self.source.splitlines(), self.new_code().splitlines()), 265s ^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s ^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s _____________________ ERROR at teardown of test_namedtuple _____________________ 265s some snapshots in this test have incorrect values. 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot 265s from collections import namedtuple 265s 265s T=namedtuple("T","a,b") 265s 265s def test_tuple(): 265s assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" 265s 265s 265s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmp661uuoyu 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_something.py F [100%] 265s 265s =================================== FAILURES =================================== 265s __________________________________ test_tuple __________________________________ 265s 265s def test_tuple(): 265s > assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" 265s 265s test_something.py:7: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:194: in assign 265s result_kwargs[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '2 ', filename = PosixPath('/tmp/tmp661uuoyu/test_something.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_something.py::test_tuple - TypeError: CliRunner.__init__() got an... 265s ============================== 1 failed in 0.25s =============================== 265s 265s stderr: 265s 265s ____________________ ERROR at teardown of test_defaultdict _____________________ 265s some snapshots in this test have incorrect values. 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot 265s from collections import defaultdict 265s 265s 265s def test_tuple(): 265s d=defaultdict(list) 265s d[1].append(2) 265s assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" 265s 265s 265s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmpmz5hzx55 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_something.py F [100%] 265s 265s =================================== FAILURES =================================== 265s __________________________________ test_tuple __________________________________ 265s 265s def test_tuple(): 265s d=defaultdict(list) 265s d[1].append(2) 265s > assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" 265s 265s test_something.py:8: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:140: in assign 265s result = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '2 ', filename = PosixPath('/tmp/tmpmz5hzx55/test_something.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_something.py::test_tuple - TypeError: CliRunner.__init__() got an... 265s ============================== 1 failed in 0.25s =============================== 265s 265s stderr: 265s 265s __________________ ERROR at teardown of test_config_pyproject __________________ 265s some snapshots in this test have incorrect values. 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_a.py 265s from inline_snapshot import snapshot 265s 265s def test_a(): 265s assert 1 <= snapshot(5) 265s assert 1 == snapshot(2) 265s 265s 265s file: pyproject.toml 265s 265s [tool.inline-snapshot] 265s default-flags = ["trim"] 265s 265s 265s run> /usr/bin/python3.12 -m pytest 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmpo03w_t0r 265s configfile: pyproject.toml 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_a.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s assert 1 <= snapshot(5) 265s > assert 1 == snapshot(2) 265s 265s test_a.py:5: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '1 ', filename = PosixPath('/tmp/tmpo03w_t0r/test_a.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 265s 265s stderr: 265s Traceback (most recent call last): 265s File "", line 198, in _run_module_as_main 265s File "", line 88, in _run_code 265s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 265s raise SystemExit(pytest.console_main()) 265s ^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 265s code = main() 265s ^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 265s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 265s return wrap_session(config, _main) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 265s config.hook.pytest_sessionfinish( 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 265s teardown.send(result) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 265s self.config.hook.pytest_terminal_summary( 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 265s for change in snapshot._changes(): 265s ^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 265s yield from self._value._get_changes() 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s _____________________ ERROR at teardown of test_config_env _____________________ 265s some snapshots in this test have incorrect values. 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_a.py 265s from inline_snapshot import snapshot 265s 265s def test_a(): 265s assert 1 <= snapshot(5) 265s assert 1 == snapshot(2) 265s 265s 265s run> /usr/bin/python3.12 -m pytest 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmpvtgditap 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_a.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s assert 1 <= snapshot(5) 265s > assert 1 == snapshot(2) 265s 265s test_a.py:5: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '1 ', filename = PosixPath('/tmp/tmpvtgditap/test_a.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 265s 265s stderr: 265s Traceback (most recent call last): 265s File "", line 198, in _run_module_as_main 265s File "", line 88, in _run_code 265s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 265s raise SystemExit(pytest.console_main()) 265s ^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 265s code = main() 265s ^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 265s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 265s return wrap_session(config, _main) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 265s config.hook.pytest_sessionfinish( 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 265s teardown.send(result) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 265s self.config.hook.pytest_terminal_summary( 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 265s for change in snapshot._changes(): 265s ^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 265s yield from self._value._get_changes() 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s _____________________ ERROR at teardown of test_shortcuts ______________________ 265s some snapshots in this test have incorrect values. 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_a.py 265s from inline_snapshot import snapshot 265s 265s def test_a(): 265s assert 1 <= snapshot(5) 265s assert 1 == snapshot(2) 265s 265s 265s file: pyproject.toml 265s 265s [tool.inline-snapshot.shortcuts] 265s strim=["trim"] 265s 265s 265s run> /usr/bin/python3.12 -m pytest --strim 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmpzn76n0yr 265s configfile: pyproject.toml 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_a.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s assert 1 <= snapshot(5) 265s > assert 1 == snapshot(2) 265s 265s test_a.py:5: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '1 ', filename = PosixPath('/tmp/tmpzn76n0yr/test_a.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 265s 265s stderr: 265s Traceback (most recent call last): 265s File "", line 198, in _run_module_as_main 265s File "", line 88, in _run_code 265s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 265s raise SystemExit(pytest.console_main()) 265s ^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 265s code = main() 265s ^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 265s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 265s return wrap_session(config, _main) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 265s config.hook.pytest_sessionfinish( 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 265s teardown.send(result) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 265s self.config.hook.pytest_terminal_summary( 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 265s for change in snapshot._changes(): 265s ^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 265s yield from self._value._get_changes() 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s _________________ ERROR at teardown of test_default_shortcuts __________________ 265s some snapshots in this test have incorrect values. 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_a.py 265s from inline_snapshot import snapshot 265s 265s def test_a(): 265s assert 1 <= snapshot(5) 265s assert 1 == snapshot(2) 265s 265s 265s file: pyproject.toml 265s 265s 265s 265s run> /usr/bin/python3.12 -m pytest --fix 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmp752s2tqx 265s configfile: pyproject.toml 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_a.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s assert 1 <= snapshot(5) 265s > assert 1 == snapshot(2) 265s 265s test_a.py:5: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '1 ', filename = PosixPath('/tmp/tmp752s2tqx/test_a.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 265s 265s stderr: 265s Traceback (most recent call last): 265s File "", line 198, in _run_module_as_main 265s File "", line 88, in _run_code 265s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 265s raise SystemExit(pytest.console_main()) 265s ^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 265s code = main() 265s ^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 265s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 265s return wrap_session(config, _main) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 265s config.hook.pytest_sessionfinish( 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 265s teardown.send(result) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 265s self.config.hook.pytest_terminal_summary( 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 265s for change in snapshot._changes(): 265s ^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 265s yield from self._value._get_changes() 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s ______________________ ERROR at teardown of test_example _______________________ 265s some snapshots in this test have incorrect values. 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_a.py 265s 265s from inline_snapshot import snapshot 265s 265s def test_a(): 265s assert 1==snapshot(2) 265s 265s 265s file: test_b.py 265s 1+1 265s 265s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create,fix 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmpnxfxoa6f 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_a.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s > assert 1==snapshot(2) 265s 265s test_a.py:5: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '1 ', filename = PosixPath('/tmp/tmpnxfxoa6f/test_a.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 265s ============================== 1 failed in 0.24s =============================== 265s 265s stderr: 265s 265s file: test_b.py 265s 1+1 265s 265s file: test_a.py 265s 265s from inline_snapshot import snapshot 265s 265s def test_a(): 265s assert 1==snapshot(2) 265s 265s 265s run> pytest /tmp/tmp80_07w_c/test_b.py 265s run> pytest /tmp/tmp80_07w_c/test_a.py 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 265s v() 265s File "/tmp/tmp80_07w_c/test_a.py", line 5, in test_a 265s assert 1==snapshot(2) 265s ^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 265s return self == other 265s ^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 265s self._changes.append(next(it)) 265s ^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 265s new_code = self.context.file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s ______________ ERROR at teardown of test_pydantic_create_snapshot ______________ 265s some snapshots in this test have incorrect values. 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s 265s from pydantic import BaseModel 265s from inline_snapshot import snapshot 265s 265s class M(BaseModel): 265s size:int 265s name:str 265s age:int=4 265s 265s def test_pydantic(): 265s m=M(size=5,name="Tom") 265s assert m==snapshot() 265s assert m.dict()==snapshot() 265s 265s 265s 265s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmp7wxbbk8e 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_something.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ________________________________ test_pydantic _________________________________ 265s 265s def test_pydantic(): 265s m=M(size=5,name="Tom") 265s > assert m==snapshot() 265s 265s test_something.py:12: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '', filename = PosixPath('/tmp/tmp7wxbbk8e/test_something.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_something.py::test_pydantic - TypeError: CliRunner.__init__() got... 265s ============================== 1 failed in 0.31s =============================== 265s 265s stderr: 265s 265s ________________ ERROR at teardown of test_pydantic_field_repr _________________ 265s some snapshots in this test have incorrect values. 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot 265s from pydantic import BaseModel,Field 265s 265s class container(BaseModel): 265s a: int 265s b: int = Field(default=5,repr=False) 265s 265s assert container(a=1,b=5) == snapshot() 265s 265s 265s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmpxjz_kpd_ 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 0 items / 1 error 265s 265s ==================================== ERRORS ==================================== 265s ______________________ ERROR collecting test_something.py ______________________ 265s test_something.py:8: in 265s assert container(a=1,b=5) == snapshot() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 265s runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s ERROR test_something.py - TypeError: CliRunner.__init__() got an unexpected k... 265s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 265s =============================== 1 error in 0.40s =============================== 265s 265s stderr: 265s 265s _______________ ERROR at teardown of test_pydantic_default_value _______________ 265s some snapshots in this test have incorrect values. 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot,Is 265s from dataclasses import dataclass,field 265s from pydantic import BaseModel,Field 265s 265s class A(BaseModel): 265s a:int 265s b:int=2 265s c:list=Field(default_factory=list) 265s 265s def test_something(): 265s assert A(a=1) == snapshot(A(a=1,b=2,c=[])) 265s 265s 265s run> /usr/bin/python3.12 -m pytest --inline-snapshot=update 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmpdmsd3bt4 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_something.py . [100%] 265s =============================== inline snapshot ================================ 265s ─────────────────────────────── Update snapshots ─────────────────────────────── 265s 265s stderr: 265s Traceback (most recent call last): 265s File "", line 198, in _run_module_as_main 265s File "", line 88, in _run_code 265s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 265s raise SystemExit(pytest.console_main()) 265s ^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 265s code = main() 265s ^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 265s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 265s return wrap_session(config, _main) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 265s config.hook.pytest_sessionfinish( 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 265s teardown.send(result) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 265s self.config.hook.pytest_terminal_summary( 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary 265s diff = file.diff() 265s ^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff 265s unified_diff(self.source.splitlines(), self.new_code().splitlines()), 265s ^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s ^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s ______________ ERROR at teardown of test_pydantic_factory_method _______________ 265s some snapshots in this test have incorrect values. 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot 265s from pydantic import BaseModel 265s 265s class A(BaseModel): 265s a:int 265s 265s @classmethod 265s def from_str(cls,s): 265s return cls(a=int(s)) 265s 265s def test_something(): 265s for a in [1,2]: 265s assert A(a=2) == snapshot(A.from_str("1")) 265s 265s 265s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmpez7lbl7_ 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_something.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ________________________________ test_something ________________________________ 265s 265s def test_something(): 265s for a in [1,2]: 265s > assert A(a=2) == snapshot(A.from_str("1")) 265s 265s test_something.py:13: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:107: in assign 265s result = yield from self.value_assign(old_value, old_node, new_value) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py:87: in value_assign 265s result = yield from adapter.assign(old_value, old_node, new_value) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = 'A (a =2 )', filename = PosixPath('/tmp/tmpez7lbl7_/test_something.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_something.py::test_something - TypeError: CliRunner.__init__() go... 265s ============================== 1 failed in 0.34s =============================== 265s 265s stderr: 265s 265s ________ ERROR at teardown of test_find_pyproject_in_parent_directories ________ 265s some snapshots in this test have incorrect values. 265s ----------------------------- Captured stdout call ----------------------------- 265s file: pyproject.toml 265s [tool.inline-snapshot] 265s hash-length=2 265s 265s 265s file: project/pytest.ini 265s 265s 265s file: project/test_something.py 265s from inline_snapshot import outsource,snapshot,external 265s 265s def test_something(): 265s assert outsource("test") == snapshot() 265s 265s 265s run> /usr/bin/python3.12 -m pytest --rootdir ./project --inline-snapshot=create 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmp29jh7q73/project 265s configfile: ../pyproject.toml 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s project/test_something.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ________________________________ test_something ________________________________ 265s 265s def test_something(): 265s > assert outsource("test") == snapshot() 265s 265s project/test_something.py:4: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '', filename = PosixPath('/tmp/tmp29jh7q73/project/test_something.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED project/test_something.py::test_something - TypeError: CliRunner.__ini... 265s ============================== 1 failed in 0.25s =============================== 265s 265s stderr: 265s 265s =================================== FAILURES =================================== 265s ________________________________ test_unmanaged ________________________________ 265s 265s def test_unmanaged(): 265s 265s Example( 265s """\ 265s from inline_snapshot import snapshot,Is 265s from dataclasses import dataclass 265s 265s @dataclass 265s class A: 265s a:int 265s b:int 265s 265s def test_something(): 265s assert A(a=2,b=4) == snapshot(A(a=1,b=Is(1))), "not equal" 265s """ 265s > ).run_inline( 265s ["--inline-snapshot=fix"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s from inline_snapshot import snapshot,Is 265s from dataclasses import dataclass 265s 265s @dataclass 265s class A: 265s a:int 265s b:int 265s 265s def test_something(): 265s assert A(a=2,b=4) == snapshot(A(a=2,b=Is(1))), "not equal" 265s """ 265s } 265s ), 265s raises=snapshot( 265s """\ 265s AssertionError: 265s not equal\ 265s """ 265s ), 265s ) 265s 265s tests/adapter/test_dataclass.py:21: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 265s assert raises == f"{type(raised_exception).__name__}:\n" + str( 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 265s filename = PosixPath('/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/adapter/test_dataclass.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot,Is 265s from dataclasses import dataclass 265s 265s @dataclass 265s class A: 265s a:int 265s b:int 265s 265s def test_something(): 265s assert A(a=2,b=4) == snapshot(A(a=1,b=Is(1))), "not equal" 265s 265s 265s run> pytest /tmp/tmpeljoabzq/test_something.py 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 265s v() 265s File "/tmp/tmpeljoabzq/test_something.py", line 10, in test_something 265s assert A(a=2,b=4) == snapshot(A(a=1,b=Is(1))), "not equal" 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 265s return self == other 265s ^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 265s self._changes.append(next(it)) 265s ^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 194, in assign 265s result_kwargs[key] = yield from self.get_adapter( 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 265s new_code = self.context.file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s _________________________________ test_reeval __________________________________ 265s 265s def test_reeval(): 265s Example( 265s """\ 265s from inline_snapshot import snapshot,Is 265s from dataclasses import dataclass 265s 265s @dataclass 265s class A: 265s a:int 265s b:int 265s 265s def test_something(): 265s for c in "ab": 265s assert A(a=1,b=c) == snapshot(A(a=2,b=Is(c))) 265s """ 265s > ).run_inline( 265s ["--inline-snapshot=fix"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s from inline_snapshot import snapshot,Is 265s from dataclasses import dataclass 265s 265s @dataclass 265s class A: 265s a:int 265s b:int 265s 265s def test_something(): 265s for c in "ab": 265s assert A(a=1,b=c) == snapshot(A(a=1,b=Is(c))) 265s """ 265s } 265s ), 265s ) 265s 265s tests/adapter/test_dataclass.py:63: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = ['--inline-snapshot=fix'] 265s 265s def run_inline( 265s self, 265s args: list[str] = [], 265s *, 265s reported_categories: Snapshot[list[Category]] | None = None, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s raises: Snapshot[str] | None = None, 265s ) -> Example: 265s """Execute the example files in process and run every `test_*` 265s function. 265s 265s This is useful for fast test execution. 265s 265s Parameters: 265s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 265s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 265s changed_files: snapshot of files which are changed by this run. 265s raises: snapshot of the exception which is raised during the test execution. 265s It is required if your code raises an exception. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s parser = ArgumentParser() 265s 265s parser.add_argument( 265s "--inline-snapshot", 265s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 265s dest="inline_snapshot", 265s help="update specific snapshot values:\n" 265s "disable: disable the snapshot logic\n" 265s "short-report: show a short report\n" 265s "report: show a longer report with a diff report\n" 265s "review: allow to approve the changes interactive\n" 265s "create: creates snapshots which are currently not defined\n" 265s "update: update snapshots even if they are defined\n" 265s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 265s "fix: change snapshots which currently break your tests\n", 265s ) 265s parsed_args = parser.parse_args(args) 265s flags = (parsed_args.inline_snapshot or "").split(",") 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s 265s self._write_files(tmp_path) 265s 265s raised_exception = None 265s with snapshot_env(): 265s with ChangeRecorder().activate() as recorder: 265s _inline_snapshot._update_flags = Flags({*flags}) 265s inline_snapshot._external.storage = ( 265s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 265s ) 265s 265s try: 265s for filename in tmp_path.glob("*.py"): 265s globals: dict[str, Any] = {} 265s print("run> pytest", filename) 265s exec( 265s compile(filename.read_text("utf-8"), filename, "exec"), 265s globals, 265s ) 265s 265s # run all test_* functions 265s for k, v in globals.items(): 265s if k.startswith("test_") and callable(v): 265s v() 265s except Exception as e: 265s traceback.print_exc() 265s raised_exception = e 265s 265s finally: 265s _inline_snapshot._active = False 265s 265s changes = [] 265s for snapshot in _inline_snapshot.snapshots.values(): 265s changes += snapshot._changes() 265s 265s snapshot_flags = {change.flag for change in changes} 265s 265s apply_all( 265s [ 265s change 265s for change in changes 265s if change.flag in _inline_snapshot._update_flags.to_set() 265s ] 265s ) 265s recorder.fix_all() 265s 265s report_output = StringIO() 265s console = Console(file=report_output) 265s 265s # TODO: add all the report output here 265s report_problems(console) 265s 265s if reported_categories is not None: 265s assert sorted(snapshot_flags) == reported_categories 265s 265s if raised_exception is not None: 265s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 265s raised_exception 265s ) 265s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 265s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot,Is 265s from dataclasses import dataclass 265s 265s @dataclass 265s class A: 265s a:int 265s b:int 265s 265s def test_something(): 265s for c in "ab": 265s assert A(a=1,b=c) == snapshot(A(a=2,b=Is(c))) 265s 265s 265s run> pytest /tmp/tmp1nnloohd/test_something.py 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 265s v() 265s File "/tmp/tmp1nnloohd/test_something.py", line 11, in test_something 265s assert A(a=1,b=c) == snapshot(A(a=2,b=Is(c))) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 265s return self == other 265s ^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 265s self._changes.append(next(it)) 265s ^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 194, in assign 265s result_kwargs[key] = yield from self.get_adapter( 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 265s new_code = self.context.file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s _________________________ test_dataclass_default_value _________________________ 265s 265s def test_dataclass_default_value(): 265s Example( 265s """\ 265s from inline_snapshot import snapshot,Is 265s from dataclasses import dataclass,field 265s 265s @dataclass 265s class A: 265s a:int 265s b:int=2 265s c:list=field(default_factory=list) 265s 265s def test_something(): 265s assert A(a=1) == snapshot(A(a=1,b=2,c=[])) 265s """ 265s > ).run_inline( 265s ["--inline-snapshot=update"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s from inline_snapshot import snapshot,Is 265s from dataclasses import dataclass,field 265s 265s @dataclass 265s class A: 265s a:int 265s b:int=2 265s c:list=field(default_factory=list) 265s 265s def test_something(): 265s assert A(a=1) == snapshot(A(a=1)) 265s """ 265s } 265s ), 265s ) 265s 265s tests/adapter/test_dataclass.py:100: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:214: in run_inline 265s recorder.fix_all() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 265s file.rewrite() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 265s new_code = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s 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' 265s filename = PosixPath('/tmp/tmpem2ea6y0/test_something.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot,Is 265s from dataclasses import dataclass,field 265s 265s @dataclass 265s class A: 265s a:int 265s b:int=2 265s c:list=field(default_factory=list) 265s 265s def test_something(): 265s assert A(a=1) == snapshot(A(a=1,b=2,c=[])) 265s 265s 265s run> pytest /tmp/tmpem2ea6y0/test_something.py 265s ___________________________ test_attrs_default_value ___________________________ 265s 265s def test_attrs_default_value(): 265s Example( 265s """\ 265s from inline_snapshot import snapshot,Is 265s import attrs 265s 265s @attrs.define 265s class A: 265s a:int 265s b:int=2 265s c:list=attrs.field(factory=list) 265s d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) 265s 265s def test_something(): 265s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 265s assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) 265s """ 265s > ).run_pytest( 265s ["--inline-snapshot=fix"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s from inline_snapshot import snapshot,Is 265s import attrs 265s 265s @attrs.define 265s class A: 265s a:int 265s b:int=2 265s c:list=attrs.field(factory=list) 265s d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) 265s 265s def test_something(): 265s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 265s assert A(a=2,b=3) == snapshot(A(a=2,b=3,c=[],d=11)) 265s """ 265s } 265s ), 265s ).run_pytest( 265s ["--inline-snapshot=update"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s from inline_snapshot import snapshot,Is 265s import attrs 265s 265s @attrs.define 265s class A: 265s a:int 265s b:int=2 265s c:list=attrs.field(factory=list) 265s d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) 265s 265s def test_something(): 265s assert A(a=1) == snapshot(A(a=1)) 265s assert A(a=2,b=3) == snapshot(A(a=2,b=3)) 265s """ 265s } 265s ), 265s ) 265s 265s tests/adapter/test_dataclass.py:139: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = ['--inline-snapshot=fix'] 265s 265s def run_pytest( 265s self, 265s args: list[str] = [], 265s *, 265s term_columns=80, 265s env: dict[str, str] = {}, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s stderr: Snapshot[str] | None = None, 265s returncode: Snapshot[int] | None = None, 265s ) -> Example: 265s """Run pytest with the given args and env variables in an seperate 265s process. 265s 265s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 265s 265s Parameters: 265s args: pytest arguments like "--inline-snapshot=fix" 265s env: dict of environment variables 265s changed_files: snapshot of files which are changed by this run. 265s report: snapshot of the report at the end of the pytest run. 265s stderr: pytest stderr output 265s returncode: snapshot of the pytest returncode. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s self._write_files(tmp_path) 265s 265s cmd = [sys.executable, "-m", "pytest", *args] 265s 265s command_env = dict(os.environ) 265s command_env["TERM"] = "unknown" 265s command_env["COLUMNS"] = str( 265s term_columns + 1 if platform.system() == "Windows" else term_columns 265s ) 265s command_env.pop("CI", None) 265s 265s command_env.update(env) 265s 265s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 265s 265s print("run>", *cmd) 265s print("stdout:") 265s print(result.stdout.decode()) 265s print("stderr:") 265s print(result.stderr.decode()) 265s 265s if returncode is not None: 265s assert result.returncode == returncode 265s 265s if stderr is not None: 265s assert result.stderr.decode() == stderr 265s 265s if report is not None: 265s 265s report_list = [] 265s record = False 265s for line in result.stdout.decode().splitlines(): 265s line = line.strip() 265s if line.startswith("===="): 265s record = False 265s 265s if record and line: 265s report_list.append(line) 265s 265s if line.startswith("====") and "inline snapshot" in line: 265s record = True 265s 265s report_str = "\n".join(report_list) 265s 265s assert normalize(report_str) == report, repr(report_str) 265s 265s if changed_files is not None: 265s current_files = {} 265s 265s for name, content in sorted(self._read_files(tmp_path).items()): 265s if name not in self.files or self.files[name] != content: 265s current_files[name] = content 265s > assert changed_files == current_files 265s E AssertionError: assert {'test_someth...=[],d=11))\n'} == {} 265s E 265s E Left contains 1 more item: 265s E {'test_something.py': 'from inline_snapshot import snapshot,Is\n' 265s E 'import attrs\n' 265s E '\n' 265s E '@attrs.define\n' 265s E 'class A:\n'... 265s E 265s E ...Full output truncated (11 lines hidden), use '-vv' to show 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot,Is 265s import attrs 265s 265s @attrs.define 265s class A: 265s a:int 265s b:int=2 265s c:list=attrs.field(factory=list) 265s d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) 265s 265s def test_something(): 265s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 265s assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) 265s 265s 265s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmpw3utt37y 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_something.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ________________________________ test_something ________________________________ 265s 265s def test_something(): 265s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 265s > assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) 265s 265s test_something.py:13: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:194: in assign 265s result_kwargs[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '2 ', filename = PosixPath('/tmp/tmpw3utt37y/test_something.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_something.py::test_something - TypeError: CliRunner.__init__() go... 265s ============================== 1 failed in 0.26s =============================== 265s 265s stderr: 265s 265s ____________________________ test_attrs_field_repr _____________________________ 265s 265s def test_attrs_field_repr(): 265s 265s Example( 265s """\ 265s from inline_snapshot import snapshot 265s import attrs 265s 265s @attrs.define 265s class container: 265s a: int 265s b: int = attrs.field(default=5,repr=False) 265s 265s assert container(a=1,b=5) == snapshot() 265s """ 265s > ).run_pytest( 265s ["--inline-snapshot=create"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s from inline_snapshot import snapshot 265s import attrs 265s 265s @attrs.define 265s class container: 265s a: int 265s b: int = attrs.field(default=5,repr=False) 265s 265s assert container(a=1,b=5) == snapshot(container(a=1)) 265s """ 265s } 265s ), 265s ).run_pytest() 265s 265s tests/adapter/test_dataclass.py:198: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = ['--inline-snapshot=create'] 265s 265s def run_pytest( 265s self, 265s args: list[str] = [], 265s *, 265s term_columns=80, 265s env: dict[str, str] = {}, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s stderr: Snapshot[str] | None = None, 265s returncode: Snapshot[int] | None = None, 265s ) -> Example: 265s """Run pytest with the given args and env variables in an seperate 265s process. 265s 265s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 265s 265s Parameters: 265s args: pytest arguments like "--inline-snapshot=fix" 265s env: dict of environment variables 265s changed_files: snapshot of files which are changed by this run. 265s report: snapshot of the report at the end of the pytest run. 265s stderr: pytest stderr output 265s returncode: snapshot of the pytest returncode. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s self._write_files(tmp_path) 265s 265s cmd = [sys.executable, "-m", "pytest", *args] 265s 265s command_env = dict(os.environ) 265s command_env["TERM"] = "unknown" 265s command_env["COLUMNS"] = str( 265s term_columns + 1 if platform.system() == "Windows" else term_columns 265s ) 265s command_env.pop("CI", None) 265s 265s command_env.update(env) 265s 265s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 265s 265s print("run>", *cmd) 265s print("stdout:") 265s print(result.stdout.decode()) 265s print("stderr:") 265s print(result.stderr.decode()) 265s 265s if returncode is not None: 265s assert result.returncode == returncode 265s 265s if stderr is not None: 265s assert result.stderr.decode() == stderr 265s 265s if report is not None: 265s 265s report_list = [] 265s record = False 265s for line in result.stdout.decode().splitlines(): 265s line = line.strip() 265s if line.startswith("===="): 265s record = False 265s 265s if record and line: 265s report_list.append(line) 265s 265s if line.startswith("====") and "inline snapshot" in line: 265s record = True 265s 265s report_str = "\n".join(report_list) 265s 265s assert normalize(report_str) == report, repr(report_str) 265s 265s if changed_files is not None: 265s current_files = {} 265s 265s for name, content in sorted(self._read_files(tmp_path).items()): 265s if name not in self.files or self.files[name] != content: 265s current_files[name] = content 265s > assert changed_files == current_files 265s E AssertionError: assert {'test_someth...iner(a=1))\n'} == {} 265s E 265s E Left contains 1 more item: 265s E {'test_something.py': 'from inline_snapshot import snapshot\n' 265s E 'import attrs\n' 265s E '\n' 265s E '@attrs.define\n' 265s E 'class container:\n'... 265s E 265s E ...Full output truncated (5 lines hidden), use '-vv' to show 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot 265s import attrs 265s 265s @attrs.define 265s class container: 265s a: int 265s b: int = attrs.field(default=5,repr=False) 265s 265s assert container(a=1,b=5) == snapshot() 265s 265s 265s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmp3pm0viwm 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 0 items / 1 error 265s 265s ==================================== ERRORS ==================================== 265s ______________________ ERROR collecting test_something.py ______________________ 265s test_something.py:9: in 265s assert container(a=1,b=5) == snapshot() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 265s runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s ERROR test_something.py - TypeError: CliRunner.__init__() got an unexpected k... 265s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 265s =============================== 1 error in 0.35s =============================== 265s 265s stderr: 265s 265s ___________________________ test_disabled[executing] ___________________________ 265s 265s executing_used = True 265s 265s def test_disabled(executing_used): 265s Example( 265s """\ 265s from inline_snapshot import snapshot 265s from dataclasses import dataclass 265s 265s @dataclass 265s class A: 265s a:int 265s 265s def test_something(): 265s assert A(a=3) == snapshot(A(a=5)),"not equal" 265s """ 265s > ).run_inline( 265s changed_files=snapshot({}), 265s raises=snapshot( 265s """\ 265s AssertionError: 265s not equal\ 265s """ 265s ), 265s ) 265s 265s tests/adapter/test_dataclass.py:261: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 265s assert raises == f"{type(raised_exception).__name__}:\n" + str( 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 265s filename = PosixPath('/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/adapter/test_dataclass.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot 265s from dataclasses import dataclass 265s 265s @dataclass 265s class A: 265s a:int 265s 265s def test_something(): 265s assert A(a=3) == snapshot(A(a=5)),"not equal" 265s 265s 265s run> pytest /tmp/tmpdvq5k782/test_something.py 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 265s v() 265s File "/tmp/tmpdvq5k782/test_something.py", line 9, in test_something 265s assert A(a=3) == snapshot(A(a=5)),"not equal" 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 265s return self == other 265s ^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 265s self._changes.append(next(it)) 265s ^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 194, in assign 265s result_kwargs[key] = yield from self.get_adapter( 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 265s new_code = self.context.file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s _______________________ test_disabled[without-executing] _______________________ 265s 265s executing_used = False 265s 265s def test_disabled(executing_used): 265s Example( 265s """\ 265s from inline_snapshot import snapshot 265s from dataclasses import dataclass 265s 265s @dataclass 265s class A: 265s a:int 265s 265s def test_something(): 265s assert A(a=3) == snapshot(A(a=5)),"not equal" 265s """ 265s > ).run_inline( 265s changed_files=snapshot({}), 265s raises=snapshot( 265s """\ 265s AssertionError: 265s not equal\ 265s """ 265s ), 265s ) 265s 265s tests/adapter/test_dataclass.py:261: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 265s assert raises == f"{type(raised_exception).__name__}:\n" + str( 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:53: in assign 265s and self.context.file._token_of_node(old_node) != new_token 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s node = 265s 265s def _token_of_node(self, node): 265s 265s return list( 265s normalize( 265s [ 265s simple_token(t.type, t.string) 265s > for t in self._source.asttokens().get_tokens(node) 265s if t.type not in ignore_tokens 265s ] 265s ) 265s ) 265s E AttributeError: 'NoneType' object has no attribute 'asttokens' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:45: AttributeError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot 265s from dataclasses import dataclass 265s 265s @dataclass 265s class A: 265s a:int 265s 265s def test_something(): 265s assert A(a=3) == snapshot(A(a=5)),"not equal" 265s 265s 265s run> pytest /tmp/tmprq2v2u40/test_something.py 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 265s v() 265s File "/tmp/tmprq2v2u40/test_something.py", line 9, in test_something 265s assert A(a=3) == snapshot(A(a=5)),"not equal" 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError: not equal 265s ______________________________ test_add_argument _______________________________ 265s 265s def test_add_argument(): 265s Example( 265s """\ 265s from inline_snapshot import snapshot 265s from dataclasses import dataclass 265s 265s @dataclass 265s class A: 265s a:int=0 265s b:int=0 265s c:int=0 265s 265s def test_something(): 265s assert A(a=3,b=3,c=3) == snapshot(A(b=3)),"not equal" 265s """ 265s > ).run_inline( 265s ["--inline-snapshot=fix"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s from inline_snapshot import snapshot 265s from dataclasses import dataclass 265s 265s @dataclass 265s class A: 265s a:int=0 265s b:int=0 265s c:int=0 265s 265s def test_something(): 265s assert A(a=3,b=3,c=3) == snapshot(A(a = 3, b=3, c = 3)),"not equal" 265s """ 265s } 265s ), 265s raises=snapshot(None), 265s ) 265s 265s tests/adapter/test_dataclass.py:322: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 265s assert raises == f"{type(raised_exception).__name__}:\n" + str( 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 265s filename = PosixPath('/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/adapter/test_dataclass.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot 265s from dataclasses import dataclass 265s 265s @dataclass 265s class A: 265s a:int=0 265s b:int=0 265s c:int=0 265s 265s def test_something(): 265s assert A(a=3,b=3,c=3) == snapshot(A(b=3)),"not equal" 265s 265s 265s run> pytest /tmp/tmp07ps1a5e/test_something.py 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 265s v() 265s File "/tmp/tmp07ps1a5e/test_something.py", line 11, in test_something 265s assert A(a=3,b=3,c=3) == snapshot(A(b=3)),"not equal" 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 265s return self == other 265s ^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 265s self._changes.append(next(it)) 265s ^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 207, in assign 265s new_code=self.context.file._value_to_code(value), 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 37, in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s _______________________ test_remove_positional_argument ________________________ 265s 265s def test_remove_positional_argument(): 265s Example( 265s """\ 265s from inline_snapshot import snapshot 265s 265s from inline_snapshot._adapter.generic_call_adapter import GenericCallAdapter,Argument 265s 265s 265s class L: 265s def __init__(self,*l): 265s self.l=l 265s 265s def __eq__(self,other): 265s if not isinstance(other,L): 265s return NotImplemented 265s return other.l==self.l 265s 265s class LAdapter(GenericCallAdapter): 265s @classmethod 265s def check_type(cls, typ): 265s return issubclass(typ,L) 265s 265s @classmethod 265s def arguments(cls, value): 265s return ([Argument(x) for x in value.l],{}) 265s 265s @classmethod 265s def argument(cls, value, pos_or_name): 265s assert isinstance(pos_or_name,int) 265s return value.l[pos_or_name] 265s 265s def test_L1(): 265s assert L(1,2) == snapshot(L(1)), "not equal" 265s 265s def test_L2(): 265s assert L(1,2) == snapshot(L(1, 2, 3)), "not equal" 265s """ 265s > ).run_pytest( 265s ["--inline-snapshot=fix"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s from inline_snapshot import snapshot 265s 265s from inline_snapshot._adapter.generic_call_adapter import GenericCallAdapter,Argument 265s 265s 265s class L: 265s def __init__(self,*l): 265s self.l=l 265s 265s def __eq__(self,other): 265s if not isinstance(other,L): 265s return NotImplemented 265s return other.l==self.l 265s 265s class LAdapter(GenericCallAdapter): 265s @classmethod 265s def check_type(cls, typ): 265s return issubclass(typ,L) 265s 265s @classmethod 265s def arguments(cls, value): 265s return ([Argument(x) for x in value.l],{}) 265s 265s @classmethod 265s def argument(cls, value, pos_or_name): 265s assert isinstance(pos_or_name,int) 265s return value.l[pos_or_name] 265s 265s def test_L1(): 265s assert L(1,2) == snapshot(L(1, 2)), "not equal" 265s 265s def test_L2(): 265s assert L(1,2) == snapshot(L(1, 2)), "not equal" 265s """ 265s } 265s ), 265s ) 265s 265s tests/adapter/test_dataclass.py:408: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = ['--inline-snapshot=fix'] 265s 265s def run_pytest( 265s self, 265s args: list[str] = [], 265s *, 265s term_columns=80, 265s env: dict[str, str] = {}, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s stderr: Snapshot[str] | None = None, 265s returncode: Snapshot[int] | None = None, 265s ) -> Example: 265s """Run pytest with the given args and env variables in an seperate 265s process. 265s 265s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 265s 265s Parameters: 265s args: pytest arguments like "--inline-snapshot=fix" 265s env: dict of environment variables 265s changed_files: snapshot of files which are changed by this run. 265s report: snapshot of the report at the end of the pytest run. 265s stderr: pytest stderr output 265s returncode: snapshot of the pytest returncode. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s self._write_files(tmp_path) 265s 265s cmd = [sys.executable, "-m", "pytest", *args] 265s 265s command_env = dict(os.environ) 265s command_env["TERM"] = "unknown" 265s command_env["COLUMNS"] = str( 265s term_columns + 1 if platform.system() == "Windows" else term_columns 265s ) 265s command_env.pop("CI", None) 265s 265s command_env.update(env) 265s 265s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 265s 265s print("run>", *cmd) 265s print("stdout:") 265s print(result.stdout.decode()) 265s print("stderr:") 265s print(result.stderr.decode()) 265s 265s if returncode is not None: 265s assert result.returncode == returncode 265s 265s if stderr is not None: 265s assert result.stderr.decode() == stderr 265s 265s if report is not None: 265s 265s report_list = [] 265s record = False 265s for line in result.stdout.decode().splitlines(): 265s line = line.strip() 265s if line.startswith("===="): 265s record = False 265s 265s if record and line: 265s report_list.append(line) 265s 265s if line.startswith("====") and "inline snapshot" in line: 265s record = True 265s 265s report_str = "\n".join(report_list) 265s 265s assert normalize(report_str) == report, repr(report_str) 265s 265s if changed_files is not None: 265s current_files = {} 265s 265s for name, content in sorted(self._read_files(tmp_path).items()): 265s if name not in self.files or self.files[name] != content: 265s current_files[name] = content 265s > assert changed_files == current_files 265s E assert {'test_someth...not equal"\n'} == {} 265s E 265s E Left contains 1 more item: 265s E {'test_something.py': 'from inline_snapshot import snapshot\n' 265s E '\n' 265s E 'from inline_snapshot._adapter.generic_call_adapter ' 265s E 'import GenericCallAdapter,Argument\n' 265s E '\n'... 265s E 265s E ...Full output truncated (30 lines hidden), use '-vv' to show 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot 265s 265s from inline_snapshot._adapter.generic_call_adapter import GenericCallAdapter,Argument 265s 265s 265s class L: 265s def __init__(self,*l): 265s self.l=l 265s 265s def __eq__(self,other): 265s if not isinstance(other,L): 265s return NotImplemented 265s return other.l==self.l 265s 265s class LAdapter(GenericCallAdapter): 265s @classmethod 265s def check_type(cls, typ): 265s return issubclass(typ,L) 265s 265s @classmethod 265s def arguments(cls, value): 265s return ([Argument(x) for x in value.l],{}) 265s 265s @classmethod 265s def argument(cls, value, pos_or_name): 265s assert isinstance(pos_or_name,int) 265s return value.l[pos_or_name] 265s 265s def test_L1(): 265s assert L(1,2) == snapshot(L(1)), "not equal" 265s 265s def test_L2(): 265s assert L(1,2) == snapshot(L(1, 2, 3)), "not equal" 265s 265s 265s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmp2ui3c5s9 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 2 items 265s 265s test_something.py F. [100%] 265s 265s =================================== FAILURES =================================== 265s ___________________________________ test_L1 ____________________________________ 265s 265s def test_L1(): 265s > assert L(1,2) == snapshot(L(1)), "not equal" 265s 265s test_something.py:30: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:162: in assign 265s new_code=self.context.file._value_to_code(value.value), 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '2 ', filename = PosixPath('/tmp/tmp2ui3c5s9/test_something.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s ──────────────────────────────── Fix snapshots ───────────────────────────────── 265s =========================== short test summary info ============================ 265s FAILED test_something.py::test_L1 - TypeError: CliRunner.__init__() got an un... 265s 265s stderr: 265s Traceback (most recent call last): 265s File "", line 198, in _run_module_as_main 265s File "", line 88, in _run_code 265s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 265s raise SystemExit(pytest.console_main()) 265s ^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 265s code = main() 265s ^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 265s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 265s return wrap_session(config, _main) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 265s config.hook.pytest_sessionfinish( 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 265s teardown.send(result) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 265s self.config.hook.pytest_terminal_summary( 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary 265s diff = file.diff() 265s ^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff 265s unified_diff(self.source.splitlines(), self.new_code().splitlines()), 265s ^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s ^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s _______________________________ test_namedtuple ________________________________ 265s 265s def test_namedtuple(): 265s Example( 265s """\ 265s from inline_snapshot import snapshot 265s from collections import namedtuple 265s 265s T=namedtuple("T","a,b") 265s 265s def test_tuple(): 265s assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" 265s """ 265s > ).run_pytest( 265s ["--inline-snapshot=fix"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s from inline_snapshot import snapshot 265s from collections import namedtuple 265s 265s T=namedtuple("T","a,b") 265s 265s def test_tuple(): 265s assert T(a=1,b=2) == snapshot(T(a=1, b=2)), "not equal" 265s """ 265s } 265s ), 265s ) 265s 265s tests/adapter/test_dataclass.py:463: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = ['--inline-snapshot=fix'] 265s 265s def run_pytest( 265s self, 265s args: list[str] = [], 265s *, 265s term_columns=80, 265s env: dict[str, str] = {}, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s stderr: Snapshot[str] | None = None, 265s returncode: Snapshot[int] | None = None, 265s ) -> Example: 265s """Run pytest with the given args and env variables in an seperate 265s process. 265s 265s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 265s 265s Parameters: 265s args: pytest arguments like "--inline-snapshot=fix" 265s env: dict of environment variables 265s changed_files: snapshot of files which are changed by this run. 265s report: snapshot of the report at the end of the pytest run. 265s stderr: pytest stderr output 265s returncode: snapshot of the pytest returncode. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s self._write_files(tmp_path) 265s 265s cmd = [sys.executable, "-m", "pytest", *args] 265s 265s command_env = dict(os.environ) 265s command_env["TERM"] = "unknown" 265s command_env["COLUMNS"] = str( 265s term_columns + 1 if platform.system() == "Windows" else term_columns 265s ) 265s command_env.pop("CI", None) 265s 265s command_env.update(env) 265s 265s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 265s 265s print("run>", *cmd) 265s print("stdout:") 265s print(result.stdout.decode()) 265s print("stderr:") 265s print(result.stderr.decode()) 265s 265s if returncode is not None: 265s assert result.returncode == returncode 265s 265s if stderr is not None: 265s assert result.stderr.decode() == stderr 265s 265s if report is not None: 265s 265s report_list = [] 265s record = False 265s for line in result.stdout.decode().splitlines(): 265s line = line.strip() 265s if line.startswith("===="): 265s record = False 265s 265s if record and line: 265s report_list.append(line) 265s 265s if line.startswith("====") and "inline snapshot" in line: 265s record = True 265s 265s report_str = "\n".join(report_list) 265s 265s assert normalize(report_str) == report, repr(report_str) 265s 265s if changed_files is not None: 265s current_files = {} 265s 265s for name, content in sorted(self._read_files(tmp_path).items()): 265s if name not in self.files or self.files[name] != content: 265s current_files[name] = content 265s > assert changed_files == current_files 265s E assert {'test_someth...not equal"\n'} == {} 265s E 265s E Left contains 1 more item: 265s E {'test_something.py': 'from inline_snapshot import snapshot\n' 265s E 'from collections import namedtuple\n' 265s E '\n' 265s E 'T=namedtuple("T","a,b")\n' 265s E '\n'... 265s E 265s E ...Full output truncated (4 lines hidden), use '-vv' to show 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot 265s from collections import namedtuple 265s 265s T=namedtuple("T","a,b") 265s 265s def test_tuple(): 265s assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" 265s 265s 265s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmp661uuoyu 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_something.py F [100%] 265s 265s =================================== FAILURES =================================== 265s __________________________________ test_tuple __________________________________ 265s 265s def test_tuple(): 265s > assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" 265s 265s test_something.py:7: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:194: in assign 265s result_kwargs[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '2 ', filename = PosixPath('/tmp/tmp661uuoyu/test_something.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_something.py::test_tuple - TypeError: CliRunner.__init__() got an... 265s ============================== 1 failed in 0.25s =============================== 265s 265s stderr: 265s 265s _______________________________ test_defaultdict _______________________________ 265s 265s def test_defaultdict(): 265s Example( 265s """\ 265s from inline_snapshot import snapshot 265s from collections import defaultdict 265s 265s 265s def test_tuple(): 265s d=defaultdict(list) 265s d[1].append(2) 265s assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" 265s """ 265s > ).run_pytest( 265s ["--inline-snapshot=fix"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s from inline_snapshot import snapshot 265s from collections import defaultdict 265s 265s 265s def test_tuple(): 265s d=defaultdict(list) 265s d[1].append(2) 265s assert d == snapshot(defaultdict(list, {1: [2]})), "not equal" 265s """ 265s } 265s ), 265s ) 265s 265s tests/adapter/test_dataclass.py:493: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = ['--inline-snapshot=fix'] 265s 265s def run_pytest( 265s self, 265s args: list[str] = [], 265s *, 265s term_columns=80, 265s env: dict[str, str] = {}, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s stderr: Snapshot[str] | None = None, 265s returncode: Snapshot[int] | None = None, 265s ) -> Example: 265s """Run pytest with the given args and env variables in an seperate 265s process. 265s 265s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 265s 265s Parameters: 265s args: pytest arguments like "--inline-snapshot=fix" 265s env: dict of environment variables 265s changed_files: snapshot of files which are changed by this run. 265s report: snapshot of the report at the end of the pytest run. 265s stderr: pytest stderr output 265s returncode: snapshot of the pytest returncode. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s self._write_files(tmp_path) 265s 265s cmd = [sys.executable, "-m", "pytest", *args] 265s 265s command_env = dict(os.environ) 265s command_env["TERM"] = "unknown" 265s command_env["COLUMNS"] = str( 265s term_columns + 1 if platform.system() == "Windows" else term_columns 265s ) 265s command_env.pop("CI", None) 265s 265s command_env.update(env) 265s 265s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 265s 265s print("run>", *cmd) 265s print("stdout:") 265s print(result.stdout.decode()) 265s print("stderr:") 265s print(result.stderr.decode()) 265s 265s if returncode is not None: 265s assert result.returncode == returncode 265s 265s if stderr is not None: 265s assert result.stderr.decode() == stderr 265s 265s if report is not None: 265s 265s report_list = [] 265s record = False 265s for line in result.stdout.decode().splitlines(): 265s line = line.strip() 265s if line.startswith("===="): 265s record = False 265s 265s if record and line: 265s report_list.append(line) 265s 265s if line.startswith("====") and "inline snapshot" in line: 265s record = True 265s 265s report_str = "\n".join(report_list) 265s 265s assert normalize(report_str) == report, repr(report_str) 265s 265s if changed_files is not None: 265s current_files = {} 265s 265s for name, content in sorted(self._read_files(tmp_path).items()): 265s if name not in self.files or self.files[name] != content: 265s current_files[name] = content 265s > assert changed_files == current_files 265s E assert {'test_someth...not equal"\n'} == {} 265s E 265s E Left contains 1 more item: 265s E {'test_something.py': 'from inline_snapshot import snapshot\n' 265s E 'from collections import defaultdict\n' 265s E '\n' 265s E '\n' 265s E 'def test_tuple():\n'... 265s E 265s E ...Full output truncated (5 lines hidden), use '-vv' to show 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot 265s from collections import defaultdict 265s 265s 265s def test_tuple(): 265s d=defaultdict(list) 265s d[1].append(2) 265s assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" 265s 265s 265s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmpmz5hzx55 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_something.py F [100%] 265s 265s =================================== FAILURES =================================== 265s __________________________________ test_tuple __________________________________ 265s 265s def test_tuple(): 265s d=defaultdict(list) 265s d[1].append(2) 265s > assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" 265s 265s test_something.py:8: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:140: in assign 265s result = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '2 ', filename = PosixPath('/tmp/tmpmz5hzx55/test_something.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_something.py::test_tuple - TypeError: CliRunner.__init__() got an... 265s ============================== 1 failed in 0.25s =============================== 265s 265s stderr: 265s 265s __________________________ test_dataclass_field_repr ___________________________ 265s 265s def test_dataclass_field_repr(): 265s 265s Example( 265s """\ 265s from inline_snapshot import snapshot 265s from dataclasses import dataclass,field 265s 265s @dataclass 265s class container: 265s a: int 265s b: int = field(default=5,repr=False) 265s 265s assert container(a=1,b=5) == snapshot() 265s """ 265s > ).run_inline( 265s ["--inline-snapshot=create"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s from inline_snapshot import snapshot 265s from dataclasses import dataclass,field 265s 265s @dataclass 265s class container: 265s a: int 265s b: int = field(default=5,repr=False) 265s 265s assert container(a=1,b=5) == snapshot(container(a=1)) 265s """ 265s } 265s ), 265s ).run_inline() 265s 265s tests/adapter/test_dataclass.py:526: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = ['--inline-snapshot=create'] 265s 265s def run_inline( 265s self, 265s args: list[str] = [], 265s *, 265s reported_categories: Snapshot[list[Category]] | None = None, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s raises: Snapshot[str] | None = None, 265s ) -> Example: 265s """Execute the example files in process and run every `test_*` 265s function. 265s 265s This is useful for fast test execution. 265s 265s Parameters: 265s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 265s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 265s changed_files: snapshot of files which are changed by this run. 265s raises: snapshot of the exception which is raised during the test execution. 265s It is required if your code raises an exception. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s parser = ArgumentParser() 265s 265s parser.add_argument( 265s "--inline-snapshot", 265s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 265s dest="inline_snapshot", 265s help="update specific snapshot values:\n" 265s "disable: disable the snapshot logic\n" 265s "short-report: show a short report\n" 265s "report: show a longer report with a diff report\n" 265s "review: allow to approve the changes interactive\n" 265s "create: creates snapshots which are currently not defined\n" 265s "update: update snapshots even if they are defined\n" 265s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 265s "fix: change snapshots which currently break your tests\n", 265s ) 265s parsed_args = parser.parse_args(args) 265s flags = (parsed_args.inline_snapshot or "").split(",") 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s 265s self._write_files(tmp_path) 265s 265s raised_exception = None 265s with snapshot_env(): 265s with ChangeRecorder().activate() as recorder: 265s _inline_snapshot._update_flags = Flags({*flags}) 265s inline_snapshot._external.storage = ( 265s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 265s ) 265s 265s try: 265s for filename in tmp_path.glob("*.py"): 265s globals: dict[str, Any] = {} 265s print("run> pytest", filename) 265s exec( 265s compile(filename.read_text("utf-8"), filename, "exec"), 265s globals, 265s ) 265s 265s # run all test_* functions 265s for k, v in globals.items(): 265s if k.startswith("test_") and callable(v): 265s v() 265s except Exception as e: 265s traceback.print_exc() 265s raised_exception = e 265s 265s finally: 265s _inline_snapshot._active = False 265s 265s changes = [] 265s for snapshot in _inline_snapshot.snapshots.values(): 265s changes += snapshot._changes() 265s 265s snapshot_flags = {change.flag for change in changes} 265s 265s apply_all( 265s [ 265s change 265s for change in changes 265s if change.flag in _inline_snapshot._update_flags.to_set() 265s ] 265s ) 265s recorder.fix_all() 265s 265s report_output = StringIO() 265s console = Console(file=report_output) 265s 265s # TODO: add all the report output here 265s report_problems(console) 265s 265s if reported_categories is not None: 265s assert sorted(snapshot_flags) == reported_categories 265s 265s if raised_exception is not None: 265s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 265s raised_exception 265s ) 265s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 265s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot 265s from dataclasses import dataclass,field 265s 265s @dataclass 265s class container: 265s a: int 265s b: int = field(default=5,repr=False) 265s 265s assert container(a=1,b=5) == snapshot() 265s 265s 265s run> pytest /tmp/tmpbu4_k8cj/test_something.py 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 185, in run_inline 265s exec( 265s File "/tmp/tmpbu4_k8cj/test_something.py", line 9, in 265s assert container(a=1,b=5) == snapshot() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 265s return self == other 265s ^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 265s self._changes.append(next(it)) 265s ^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 265s new_code = self.context.file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s ______________________________ test_dataclass_var ______________________________ 265s 265s def test_dataclass_var(): 265s 265s Example( 265s """\ 265s from inline_snapshot import snapshot,Is 265s from dataclasses import dataclass,field 265s 265s @dataclass 265s class container: 265s a: int 265s 265s def test_list(): 265s l=container(5) 265s assert l == snapshot(l), "not equal" 265s """ 265s > ).run_inline( 265s ["--inline-snapshot=update"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s from inline_snapshot import snapshot,Is 265s from dataclasses import dataclass,field 265s 265s @dataclass 265s class container: 265s a: int 265s 265s def test_list(): 265s l=container(5) 265s assert l == snapshot(container(a=5)), "not equal" 265s """ 265s } 265s ), 265s ) 265s 265s tests/adapter/test_dataclass.py:561: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = ['--inline-snapshot=update'] 265s 265s def run_inline( 265s self, 265s args: list[str] = [], 265s *, 265s reported_categories: Snapshot[list[Category]] | None = None, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s raises: Snapshot[str] | None = None, 265s ) -> Example: 265s """Execute the example files in process and run every `test_*` 265s function. 265s 265s This is useful for fast test execution. 265s 265s Parameters: 265s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 265s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 265s changed_files: snapshot of files which are changed by this run. 265s raises: snapshot of the exception which is raised during the test execution. 265s It is required if your code raises an exception. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s parser = ArgumentParser() 265s 265s parser.add_argument( 265s "--inline-snapshot", 265s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 265s dest="inline_snapshot", 265s help="update specific snapshot values:\n" 265s "disable: disable the snapshot logic\n" 265s "short-report: show a short report\n" 265s "report: show a longer report with a diff report\n" 265s "review: allow to approve the changes interactive\n" 265s "create: creates snapshots which are currently not defined\n" 265s "update: update snapshots even if they are defined\n" 265s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 265s "fix: change snapshots which currently break your tests\n", 265s ) 265s parsed_args = parser.parse_args(args) 265s flags = (parsed_args.inline_snapshot or "").split(",") 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s 265s self._write_files(tmp_path) 265s 265s raised_exception = None 265s with snapshot_env(): 265s with ChangeRecorder().activate() as recorder: 265s _inline_snapshot._update_flags = Flags({*flags}) 265s inline_snapshot._external.storage = ( 265s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 265s ) 265s 265s try: 265s for filename in tmp_path.glob("*.py"): 265s globals: dict[str, Any] = {} 265s print("run> pytest", filename) 265s exec( 265s compile(filename.read_text("utf-8"), filename, "exec"), 265s globals, 265s ) 265s 265s # run all test_* functions 265s for k, v in globals.items(): 265s if k.startswith("test_") and callable(v): 265s v() 265s except Exception as e: 265s traceback.print_exc() 265s raised_exception = e 265s 265s finally: 265s _inline_snapshot._active = False 265s 265s changes = [] 265s for snapshot in _inline_snapshot.snapshots.values(): 265s changes += snapshot._changes() 265s 265s snapshot_flags = {change.flag for change in changes} 265s 265s apply_all( 265s [ 265s change 265s for change in changes 265s if change.flag in _inline_snapshot._update_flags.to_set() 265s ] 265s ) 265s recorder.fix_all() 265s 265s report_output = StringIO() 265s console = Console(file=report_output) 265s 265s # TODO: add all the report output here 265s report_problems(console) 265s 265s if reported_categories is not None: 265s assert sorted(snapshot_flags) == reported_categories 265s 265s if raised_exception is not None: 265s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 265s raised_exception 265s ) 265s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 265s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot,Is 265s from dataclasses import dataclass,field 265s 265s @dataclass 265s class container: 265s a: int 265s 265s def test_list(): 265s l=container(5) 265s assert l == snapshot(l), "not equal" 265s 265s 265s run> pytest /tmp/tmp1v7bxse8/test_something.py 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 265s v() 265s File "/tmp/tmp1v7bxse8/test_something.py", line 10, in test_list 265s assert l == snapshot(l), "not equal" 265s ^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 265s return self == other 265s ^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 265s self._changes.append(next(it)) 265s ^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 101, in assign 265s result = yield from self.value_assign(old_value, old_node, new_value) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py", line 87, in value_assign 265s result = yield from adapter.assign(old_value, old_node, new_value) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 265s new_code = self.context.file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s ________________________________ test_dict_var _________________________________ 265s 265s def test_dict_var(): 265s 265s Example( 265s """\ 265s from inline_snapshot import snapshot,Is 265s 265s def test_list(): 265s l={1:2} 265s assert l == snapshot(l), "not equal" 265s """ 265s > ).run_inline( 265s ["--inline-snapshot=update"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s from inline_snapshot import snapshot,Is 265s 265s def test_list(): 265s l={1:2} 265s assert l == snapshot({1: 2}), "not equal" 265s """ 265s } 265s ), 265s ) 265s 265s tests/adapter/test_dict.py:15: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = ['--inline-snapshot=update'] 265s 265s def run_inline( 265s self, 265s args: list[str] = [], 265s *, 265s reported_categories: Snapshot[list[Category]] | None = None, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s raises: Snapshot[str] | None = None, 265s ) -> Example: 265s """Execute the example files in process and run every `test_*` 265s function. 265s 265s This is useful for fast test execution. 265s 265s Parameters: 265s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 265s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 265s changed_files: snapshot of files which are changed by this run. 265s raises: snapshot of the exception which is raised during the test execution. 265s It is required if your code raises an exception. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s parser = ArgumentParser() 265s 265s parser.add_argument( 265s "--inline-snapshot", 265s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 265s dest="inline_snapshot", 265s help="update specific snapshot values:\n" 265s "disable: disable the snapshot logic\n" 265s "short-report: show a short report\n" 265s "report: show a longer report with a diff report\n" 265s "review: allow to approve the changes interactive\n" 265s "create: creates snapshots which are currently not defined\n" 265s "update: update snapshots even if they are defined\n" 265s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 265s "fix: change snapshots which currently break your tests\n", 265s ) 265s parsed_args = parser.parse_args(args) 265s flags = (parsed_args.inline_snapshot or "").split(",") 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s 265s self._write_files(tmp_path) 265s 265s raised_exception = None 265s with snapshot_env(): 265s with ChangeRecorder().activate() as recorder: 265s _inline_snapshot._update_flags = Flags({*flags}) 265s inline_snapshot._external.storage = ( 265s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 265s ) 265s 265s try: 265s for filename in tmp_path.glob("*.py"): 265s globals: dict[str, Any] = {} 265s print("run> pytest", filename) 265s exec( 265s compile(filename.read_text("utf-8"), filename, "exec"), 265s globals, 265s ) 265s 265s # run all test_* functions 265s for k, v in globals.items(): 265s if k.startswith("test_") and callable(v): 265s v() 265s except Exception as e: 265s traceback.print_exc() 265s raised_exception = e 265s 265s finally: 265s _inline_snapshot._active = False 265s 265s changes = [] 265s for snapshot in _inline_snapshot.snapshots.values(): 265s changes += snapshot._changes() 265s 265s snapshot_flags = {change.flag for change in changes} 265s 265s apply_all( 265s [ 265s change 265s for change in changes 265s if change.flag in _inline_snapshot._update_flags.to_set() 265s ] 265s ) 265s recorder.fix_all() 265s 265s report_output = StringIO() 265s console = Console(file=report_output) 265s 265s # TODO: add all the report output here 265s report_problems(console) 265s 265s if reported_categories is not None: 265s assert sorted(snapshot_flags) == reported_categories 265s 265s if raised_exception is not None: 265s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 265s raised_exception 265s ) 265s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 265s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot,Is 265s 265s def test_list(): 265s l={1:2} 265s assert l == snapshot(l), "not equal" 265s 265s 265s run> pytest /tmp/tmp2vzhkvg8/test_something.py 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 265s v() 265s File "/tmp/tmp2vzhkvg8/test_something.py", line 5, in test_list 265s assert l == snapshot(l), "not equal" 265s ^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 265s return self == other 265s ^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 265s self._changes.append(next(it)) 265s ^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py", line 62, in assign 265s result = yield from self.value_assign(old_value, old_node, new_value) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py", line 87, in value_assign 265s result = yield from adapter.assign(old_value, old_node, new_value) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 265s new_code = self.context.file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s ____________________________ test_adapter_mismatch _____________________________ 265s 265s def test_adapter_mismatch(): 265s 265s Example( 265s """\ 265s from inline_snapshot import snapshot 265s 265s 265s def test_thing(): 265s assert [1,2] == snapshot({1:2}) 265s 265s """ 265s > ).run_inline( 265s ["--inline-snapshot=fix"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s from inline_snapshot import snapshot 265s 265s 265s def test_thing(): 265s assert [1,2] == snapshot([1, 2]) 265s 265s \ 265s """ 265s } 265s ), 265s ) 265s 265s tests/adapter/test_general.py:16: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = ['--inline-snapshot=fix'] 265s 265s def run_inline( 265s self, 265s args: list[str] = [], 265s *, 265s reported_categories: Snapshot[list[Category]] | None = None, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s raises: Snapshot[str] | None = None, 265s ) -> Example: 265s """Execute the example files in process and run every `test_*` 265s function. 265s 265s This is useful for fast test execution. 265s 265s Parameters: 265s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 265s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 265s changed_files: snapshot of files which are changed by this run. 265s raises: snapshot of the exception which is raised during the test execution. 265s It is required if your code raises an exception. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s parser = ArgumentParser() 265s 265s parser.add_argument( 265s "--inline-snapshot", 265s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 265s dest="inline_snapshot", 265s help="update specific snapshot values:\n" 265s "disable: disable the snapshot logic\n" 265s "short-report: show a short report\n" 265s "report: show a longer report with a diff report\n" 265s "review: allow to approve the changes interactive\n" 265s "create: creates snapshots which are currently not defined\n" 265s "update: update snapshots even if they are defined\n" 265s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 265s "fix: change snapshots which currently break your tests\n", 265s ) 265s parsed_args = parser.parse_args(args) 265s flags = (parsed_args.inline_snapshot or "").split(",") 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s 265s self._write_files(tmp_path) 265s 265s raised_exception = None 265s with snapshot_env(): 265s with ChangeRecorder().activate() as recorder: 265s _inline_snapshot._update_flags = Flags({*flags}) 265s inline_snapshot._external.storage = ( 265s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 265s ) 265s 265s try: 265s for filename in tmp_path.glob("*.py"): 265s globals: dict[str, Any] = {} 265s print("run> pytest", filename) 265s exec( 265s compile(filename.read_text("utf-8"), filename, "exec"), 265s globals, 265s ) 265s 265s # run all test_* functions 265s for k, v in globals.items(): 265s if k.startswith("test_") and callable(v): 265s v() 265s except Exception as e: 265s traceback.print_exc() 265s raised_exception = e 265s 265s finally: 265s _inline_snapshot._active = False 265s 265s changes = [] 265s for snapshot in _inline_snapshot.snapshots.values(): 265s changes += snapshot._changes() 265s 265s snapshot_flags = {change.flag for change in changes} 265s 265s apply_all( 265s [ 265s change 265s for change in changes 265s if change.flag in _inline_snapshot._update_flags.to_set() 265s ] 265s ) 265s recorder.fix_all() 265s 265s report_output = StringIO() 265s console = Console(file=report_output) 265s 265s # TODO: add all the report output here 265s report_problems(console) 265s 265s if reported_categories is not None: 265s assert sorted(snapshot_flags) == reported_categories 265s 265s if raised_exception is not None: 265s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 265s raised_exception 265s ) 265s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 265s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot 265s 265s 265s def test_thing(): 265s assert [1,2] == snapshot({1:2}) 265s 265s 265s 265s run> pytest /tmp/tmpr0wgulfz/test_something.py 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 265s v() 265s File "/tmp/tmpr0wgulfz/test_something.py", line 5, in test_thing 265s assert [1,2] == snapshot({1:2}) 265s ^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 265s return self == other 265s ^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 265s self._changes.append(next(it)) 265s ^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 265s new_code = self.context.file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s ___________________ test_list_adapter_create_inner_snapshot ____________________ 265s 265s def test_list_adapter_create_inner_snapshot(): 265s 265s Example( 265s """\ 265s from inline_snapshot import snapshot 265s from dirty_equals import IsInt 265s 265s def test_list(): 265s 265s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(),4]),"not equal" 265s """ 265s > ).run_inline( 265s ["--inline-snapshot=create"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s from inline_snapshot import snapshot 265s from dirty_equals import IsInt 265s 265s def test_list(): 265s 265s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(3),4]),"not equal" 265s """ 265s } 265s ), 265s raises=snapshot(None), 265s ) 265s 265s tests/adapter/test_sequence.py:17: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 265s assert raises == f"{type(raised_exception).__name__}:\n" + str( 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 265s filename = PosixPath('/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/adapter/test_sequence.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot 265s from dirty_equals import IsInt 265s 265s def test_list(): 265s 265s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(),4]),"not equal" 265s 265s 265s run> pytest /tmp/tmp7aqbyws_/test_something.py 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 265s v() 265s File "/tmp/tmp7aqbyws_/test_something.py", line 6, in test_list 265s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(),4]),"not equal" 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 265s return self == other 265s ^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 280, in __eq__ 265s return _return(self._visible_value() == other) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_unmanaged.py", line 44, in __eq__ 265s return self.value == other 265s ^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 265s self._changes.append(next(it)) 265s ^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 265s new_code = self.context.file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s _____________________ test_list_adapter_fix_inner_snapshot _____________________ 265s 265s def test_list_adapter_fix_inner_snapshot(): 265s 265s Example( 265s """\ 265s from inline_snapshot import snapshot 265s from dirty_equals import IsInt 265s 265s def test_list(): 265s 265s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(8),4]),"not equal" 265s """ 265s > ).run_inline( 265s ["--inline-snapshot=fix"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s from inline_snapshot import snapshot 265s from dirty_equals import IsInt 265s 265s def test_list(): 265s 265s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(3),4]),"not equal" 265s """ 265s } 265s ), 265s raises=snapshot(None), 265s ) 265s 265s tests/adapter/test_sequence.py:46: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 265s assert raises == f"{type(raised_exception).__name__}:\n" + str( 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 265s filename = PosixPath('/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/adapter/test_sequence.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot 265s from dirty_equals import IsInt 265s 265s def test_list(): 265s 265s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(8),4]),"not equal" 265s 265s 265s run> pytest /tmp/tmporv29x1l/test_something.py 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 265s v() 265s File "/tmp/tmporv29x1l/test_something.py", line 6, in test_list 265s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(8),4]),"not equal" 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 265s return self == other 265s ^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 280, in __eq__ 265s return _return(self._visible_value() == other) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_unmanaged.py", line 44, in __eq__ 265s return self.value == other 265s ^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 265s self._changes.append(next(it)) 265s ^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 265s new_code = self.context.file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s ________________________________ test_list_var _________________________________ 265s 265s def test_list_var(): 265s 265s Example( 265s """\ 265s from inline_snapshot import snapshot,Is 265s 265s def test_list(): 265s l=[1] 265s assert l == snapshot(l), "not equal" 265s """ 265s > ).run_inline( 265s ["--inline-snapshot=update"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s from inline_snapshot import snapshot,Is 265s 265s def test_list(): 265s l=[1] 265s assert l == snapshot([1]), "not equal" 265s """ 265s } 265s ), 265s ) 265s 265s tests/adapter/test_sequence.py:92: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = ['--inline-snapshot=update'] 265s 265s def run_inline( 265s self, 265s args: list[str] = [], 265s *, 265s reported_categories: Snapshot[list[Category]] | None = None, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s raises: Snapshot[str] | None = None, 265s ) -> Example: 265s """Execute the example files in process and run every `test_*` 265s function. 265s 265s This is useful for fast test execution. 265s 265s Parameters: 265s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 265s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 265s changed_files: snapshot of files which are changed by this run. 265s raises: snapshot of the exception which is raised during the test execution. 265s It is required if your code raises an exception. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s parser = ArgumentParser() 265s 265s parser.add_argument( 265s "--inline-snapshot", 265s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 265s dest="inline_snapshot", 265s help="update specific snapshot values:\n" 265s "disable: disable the snapshot logic\n" 265s "short-report: show a short report\n" 265s "report: show a longer report with a diff report\n" 265s "review: allow to approve the changes interactive\n" 265s "create: creates snapshots which are currently not defined\n" 265s "update: update snapshots even if they are defined\n" 265s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 265s "fix: change snapshots which currently break your tests\n", 265s ) 265s parsed_args = parser.parse_args(args) 265s flags = (parsed_args.inline_snapshot or "").split(",") 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s 265s self._write_files(tmp_path) 265s 265s raised_exception = None 265s with snapshot_env(): 265s with ChangeRecorder().activate() as recorder: 265s _inline_snapshot._update_flags = Flags({*flags}) 265s inline_snapshot._external.storage = ( 265s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 265s ) 265s 265s try: 265s for filename in tmp_path.glob("*.py"): 265s globals: dict[str, Any] = {} 265s print("run> pytest", filename) 265s exec( 265s compile(filename.read_text("utf-8"), filename, "exec"), 265s globals, 265s ) 265s 265s # run all test_* functions 265s for k, v in globals.items(): 265s if k.startswith("test_") and callable(v): 265s v() 265s except Exception as e: 265s traceback.print_exc() 265s raised_exception = e 265s 265s finally: 265s _inline_snapshot._active = False 265s 265s changes = [] 265s for snapshot in _inline_snapshot.snapshots.values(): 265s changes += snapshot._changes() 265s 265s snapshot_flags = {change.flag for change in changes} 265s 265s apply_all( 265s [ 265s change 265s for change in changes 265s if change.flag in _inline_snapshot._update_flags.to_set() 265s ] 265s ) 265s recorder.fix_all() 265s 265s report_output = StringIO() 265s console = Console(file=report_output) 265s 265s # TODO: add all the report output here 265s report_problems(console) 265s 265s if reported_categories is not None: 265s assert sorted(snapshot_flags) == reported_categories 265s 265s if raised_exception is not None: 265s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 265s raised_exception 265s ) 265s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 265s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot,Is 265s 265s def test_list(): 265s l=[1] 265s assert l == snapshot(l), "not equal" 265s 265s 265s run> pytest /tmp/tmp291w__u4/test_something.py 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 265s v() 265s File "/tmp/tmp291w__u4/test_something.py", line 5, in test_list 265s assert l == snapshot(l), "not equal" 265s ^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 265s return self == other 265s ^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 265s self._changes.append(next(it)) 265s ^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py", line 52, in assign 265s result = yield from self.value_assign(old_value, old_node, new_value) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py", line 87, in value_assign 265s result = yield from adapter.assign(old_value, old_node, new_value) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 265s new_code = self.context.file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s __________________________ test_change_function_args ___________________________ 265s 265s check_change = .w at 0x611fc2b25940> 265s 265s def test_change_function_args(check_change): 265s 265s > check_change( 265s "f(a,b=2)", 265s lambda source, call: [ 265s Replace( 265s flag="fix", 265s file=source, 265s node=call.args[0], 265s new_code="22", 265s old_value=0, 265s new_value=0, 265s ) 265s ], 265s snapshot("f(22,b=2)"), 265s ) 265s 265s tests/test_change.py:48: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/test_change.py:37: in w 265s cr.virtual_write() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:244: in virtual_write 265s file.virtual_write() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:141: in virtual_write 265s self.source = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = 'f(a,b=2)' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_change_function_args0/test_0.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s test: f(a,b=2) 265s __________________________________ test_enum ___________________________________ 265s 265s check_update = .w at 0x611fc2b254e0> 265s 265s def test_enum(check_update): 265s 265s assert ( 265s > check_update( 265s """ 265s from enum import Enum 265s 265s class color(Enum): 265s val="val" 265s 265s 265s assert [color.val] == snapshot() 265s 265s """, 265s flags="create", 265s ) 265s == snapshot( 265s """\ 265s 265s from enum import Enum 265s 265s class color(Enum): 265s val="val" 265s 265s 265s assert [color.val] == snapshot([color.val]) 265s 265s """ 265s ) 265s ) 265s 265s tests/test_code_repr.py:15: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_enum0/test_1.py:16: in 265s assert [color.val] == snapshot() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_enum0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s | 265s |from enum import Enum 265s | 265s |class color(Enum): 265s | val="val" 265s | 265s | 265s |assert [color.val] == snapshot() 265s | 265s _______________________ test_snapshot_generates_hasrepr ________________________ 265s 265s def test_snapshot_generates_hasrepr(): 265s 265s Example( 265s """\ 265s from inline_snapshot import snapshot 265s 265s class Thing: 265s def __repr__(self): 265s return "" 265s 265s def __eq__(self,other): 265s if not isinstance(other,Thing): 265s return NotImplemented 265s return True 265s 265s def test_thing(): 265s assert Thing() == snapshot() 265s 265s """ 265s > ).run_pytest( 265s ["--inline-snapshot=create"], 265s returncode=snapshot(0), 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s from inline_snapshot import snapshot 265s 265s from inline_snapshot import HasRepr 265s 265s class Thing: 265s def __repr__(self): 265s return "" 265s 265s def __eq__(self,other): 265s if not isinstance(other,Thing): 265s return NotImplemented 265s return True 265s 265s def test_thing(): 265s assert Thing() == snapshot(HasRepr(Thing, "")) 265s 265s \ 265s """ 265s } 265s ), 265s ).run_pytest( 265s ["--inline-snapshot=disable"], returncode=0 265s ).run_pytest( 265s returncode=0 265s ) 265s 265s tests/test_code_repr.py:63: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:297: in run_pytest 265s assert result.returncode == returncode 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '1 ' 265s filename = PosixPath('/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_code_repr.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot 265s 265s class Thing: 265s def __repr__(self): 265s return "" 265s 265s def __eq__(self,other): 265s if not isinstance(other,Thing): 265s return NotImplemented 265s return True 265s 265s def test_thing(): 265s assert Thing() == snapshot() 265s 265s 265s 265s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmpats_xhsm 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_something.py F [100%] 265s 265s =================================== FAILURES =================================== 265s __________________________________ test_thing __________________________________ 265s 265s def test_thing(): 265s > assert Thing() == snapshot() 265s 265s test_something.py:13: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '', filename = PosixPath('/tmp/tmpats_xhsm/test_something.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_something.py::test_thing - TypeError: CliRunner.__init__() got an... 265s ============================== 1 failed in 0.27s =============================== 265s 265s stderr: 265s 265s ____________________________ test_enum_in_dataclass ____________________________ 265s 265s check_update = .w at 0x611fc2b24f40> 265s 265s def test_enum_in_dataclass(check_update): 265s 265s assert ( 265s > check_update( 265s """ 265s from enum import Enum 265s from dataclasses import dataclass 265s 265s class color(Enum): 265s red="red" 265s blue="blue" 265s 265s @dataclass 265s class container: 265s bg: color=color.red 265s fg: color=color.blue 265s 265s assert container(bg=color.red,fg=color.red) == snapshot() 265s 265s """, 265s flags="create", 265s ) 265s == snapshot( 265s """\ 265s 265s from enum import Enum 265s from dataclasses import dataclass 265s 265s class color(Enum): 265s red="red" 265s blue="blue" 265s 265s @dataclass 265s class container: 265s bg: color=color.red 265s fg: color=color.blue 265s 265s assert container(bg=color.red,fg=color.red) == snapshot(container(fg=color.red)) 265s 265s """ 265s ) 265s ) 265s 265s tests/test_code_repr.py:106: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_enum_in_dataclass0/test_1.py:22: in 265s assert container(bg=color.red,fg=color.red) == snapshot() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_enum_in_dataclass0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s | 265s |from enum import Enum 265s |from dataclasses import dataclass 265s | 265s |class color(Enum): 265s | red="red" 265s | blue="blue" 265s | 265s |@dataclass 265s |class container: 265s | bg: color=color.red 265s | fg: color=color.blue 265s | 265s |assert container(bg=color.red,fg=color.red) == snapshot() 265s | 265s __________________________________ test_flag ___________________________________ 265s 265s check_update = .w at 0x611fc2b25bc0> 265s 265s def test_flag(check_update): 265s 265s assert ( 265s > check_update( 265s """ 265s from enum import Flag, auto 265s 265s class Color(Flag): 265s red = auto() 265s green = auto() 265s blue = auto() 265s 265s assert Color.red | Color.blue == snapshot() 265s 265s """, 265s flags="create", 265s ) 265s == snapshot( 265s """\ 265s 265s from enum import Flag, auto 265s 265s class Color(Flag): 265s red = auto() 265s green = auto() 265s blue = auto() 265s 265s assert Color.red | Color.blue == snapshot(Color.red | Color.blue) 265s 265s """ 265s ) 265s ) 265s 265s tests/test_code_repr.py:150: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_flag0/test_1.py:17: in 265s assert Color.red | Color.blue == snapshot() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_flag0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s | 265s |from enum import Flag, auto 265s | 265s |class Color(Flag): 265s | red = auto() 265s | green = auto() 265s | blue = auto() 265s | 265s |assert Color.red | Color.blue == snapshot() 265s | 265s __________________________________ test_type ___________________________________ 265s 265s check_update = .w at 0x611fc2b26520> 265s 265s def test_type(check_update): 265s 265s assert ( 265s > check_update( 265s """\ 265s class Color: 265s pass 265s 265s assert [Color,int] == snapshot() 265s 265s """, 265s flags="create", 265s ) 265s == snapshot( 265s """\ 265s class Color: 265s pass 265s 265s assert [Color,int] == snapshot([Color, int]) 265s 265s """ 265s ) 265s ) 265s 265s tests/test_code_repr.py:184: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_type0/test_1.py:12: in 265s assert [Color,int] == snapshot() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_type0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |class Color: 265s | pass 265s | 265s |assert [Color,int] == snapshot() 265s | 265s ________________________________ test_qualname _________________________________ 265s 265s def test_qualname(): 265s 265s Example( 265s """\ 265s from enum import Enum 265s from inline_snapshot import snapshot 265s 265s 265s class Namespace: 265s class Color(Enum): 265s red="red" 265s 265s assert Namespace.Color.red == snapshot() 265s 265s """ 265s > ).run_inline( 265s ["--inline-snapshot=create"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s from enum import Enum 265s from inline_snapshot import snapshot 265s 265s 265s class Namespace: 265s class Color(Enum): 265s red="red" 265s 265s assert Namespace.Color.red == snapshot(Namespace.Color.red) 265s 265s \ 265s """ 265s } 265s ), 265s ).run_inline() 265s 265s tests/test_code_repr.py:221: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = ['--inline-snapshot=create'] 265s 265s def run_inline( 265s self, 265s args: list[str] = [], 265s *, 265s reported_categories: Snapshot[list[Category]] | None = None, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s raises: Snapshot[str] | None = None, 265s ) -> Example: 265s """Execute the example files in process and run every `test_*` 265s function. 265s 265s This is useful for fast test execution. 265s 265s Parameters: 265s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 265s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 265s changed_files: snapshot of files which are changed by this run. 265s raises: snapshot of the exception which is raised during the test execution. 265s It is required if your code raises an exception. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s parser = ArgumentParser() 265s 265s parser.add_argument( 265s "--inline-snapshot", 265s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 265s dest="inline_snapshot", 265s help="update specific snapshot values:\n" 265s "disable: disable the snapshot logic\n" 265s "short-report: show a short report\n" 265s "report: show a longer report with a diff report\n" 265s "review: allow to approve the changes interactive\n" 265s "create: creates snapshots which are currently not defined\n" 265s "update: update snapshots even if they are defined\n" 265s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 265s "fix: change snapshots which currently break your tests\n", 265s ) 265s parsed_args = parser.parse_args(args) 265s flags = (parsed_args.inline_snapshot or "").split(",") 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s 265s self._write_files(tmp_path) 265s 265s raised_exception = None 265s with snapshot_env(): 265s with ChangeRecorder().activate() as recorder: 265s _inline_snapshot._update_flags = Flags({*flags}) 265s inline_snapshot._external.storage = ( 265s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 265s ) 265s 265s try: 265s for filename in tmp_path.glob("*.py"): 265s globals: dict[str, Any] = {} 265s print("run> pytest", filename) 265s exec( 265s compile(filename.read_text("utf-8"), filename, "exec"), 265s globals, 265s ) 265s 265s # run all test_* functions 265s for k, v in globals.items(): 265s if k.startswith("test_") and callable(v): 265s v() 265s except Exception as e: 265s traceback.print_exc() 265s raised_exception = e 265s 265s finally: 265s _inline_snapshot._active = False 265s 265s changes = [] 265s for snapshot in _inline_snapshot.snapshots.values(): 265s changes += snapshot._changes() 265s 265s snapshot_flags = {change.flag for change in changes} 265s 265s apply_all( 265s [ 265s change 265s for change in changes 265s if change.flag in _inline_snapshot._update_flags.to_set() 265s ] 265s ) 265s recorder.fix_all() 265s 265s report_output = StringIO() 265s console = Console(file=report_output) 265s 265s # TODO: add all the report output here 265s report_problems(console) 265s 265s if reported_categories is not None: 265s assert sorted(snapshot_flags) == reported_categories 265s 265s if raised_exception is not None: 265s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 265s raised_exception 265s ) 265s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 265s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from enum import Enum 265s from inline_snapshot import snapshot 265s 265s 265s class Namespace: 265s class Color(Enum): 265s red="red" 265s 265s assert Namespace.Color.red == snapshot() 265s 265s 265s 265s run> pytest /tmp/tmpyfde01ev/test_something.py 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 185, in run_inline 265s exec( 265s File "/tmp/tmpyfde01ev/test_something.py", line 9, in 265s assert Namespace.Color.red == snapshot() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 265s return self == other 265s ^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 265s self._changes.append(next(it)) 265s ^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 265s new_code = self.context.file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s ______________________________ test_invalid_repr _______________________________ 265s 265s check_update = .w at 0x611fc296af20> 265s 265s def test_invalid_repr(check_update): 265s assert ( 265s > check_update( 265s """\ 265s class Thing: 265s def __repr__(self): 265s return "+++" 265s 265s def __eq__(self,other): 265s if not isinstance(other,Thing): 265s return NotImplemented 265s return True 265s 265s assert Thing() == snapshot() 265s """, 265s flags="create", 265s ) 265s == snapshot( 265s """\ 265s class Thing: 265s def __repr__(self): 265s return "+++" 265s 265s def __eq__(self,other): 265s if not isinstance(other,Thing): 265s return NotImplemented 265s return True 265s 265s assert Thing() == snapshot(HasRepr(Thing, "+++")) 265s """ 265s ) 265s ) 265s 265s tests/test_code_repr.py:351: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_invalid_repr0/test_1.py:18: in 265s assert Thing() == snapshot() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_invalid_repr0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |class Thing: 265s | def __repr__(self): 265s | return "+++" 265s | 265s | def __eq__(self,other): 265s | if not isinstance(other,Thing): 265s | return NotImplemented 265s | return True 265s | 265s |assert Thing() == snapshot() 265s ____________________________ test_config_pyproject _____________________________ 265s 265s def test_config_pyproject(): 265s 265s Example( 265s { 265s **file_to_trim, 265s "pyproject.toml": """ 265s [tool.inline-snapshot] 265s default-flags = ["trim"] 265s """, 265s } 265s > ).run_pytest(changed_files=trimmed_files) 265s 265s tests/test_config.py:37: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = [] 265s 265s def run_pytest( 265s self, 265s args: list[str] = [], 265s *, 265s term_columns=80, 265s env: dict[str, str] = {}, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s stderr: Snapshot[str] | None = None, 265s returncode: Snapshot[int] | None = None, 265s ) -> Example: 265s """Run pytest with the given args and env variables in an seperate 265s process. 265s 265s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 265s 265s Parameters: 265s args: pytest arguments like "--inline-snapshot=fix" 265s env: dict of environment variables 265s changed_files: snapshot of files which are changed by this run. 265s report: snapshot of the report at the end of the pytest run. 265s stderr: pytest stderr output 265s returncode: snapshot of the pytest returncode. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s self._write_files(tmp_path) 265s 265s cmd = [sys.executable, "-m", "pytest", *args] 265s 265s command_env = dict(os.environ) 265s command_env["TERM"] = "unknown" 265s command_env["COLUMNS"] = str( 265s term_columns + 1 if platform.system() == "Windows" else term_columns 265s ) 265s command_env.pop("CI", None) 265s 265s command_env.update(env) 265s 265s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 265s 265s print("run>", *cmd) 265s print("stdout:") 265s print(result.stdout.decode()) 265s print("stderr:") 265s print(result.stderr.decode()) 265s 265s if returncode is not None: 265s assert result.returncode == returncode 265s 265s if stderr is not None: 265s assert result.stderr.decode() == stderr 265s 265s if report is not None: 265s 265s report_list = [] 265s record = False 265s for line in result.stdout.decode().splitlines(): 265s line = line.strip() 265s if line.startswith("===="): 265s record = False 265s 265s if record and line: 265s report_list.append(line) 265s 265s if line.startswith("====") and "inline snapshot" in line: 265s record = True 265s 265s report_str = "\n".join(report_list) 265s 265s assert normalize(report_str) == report, repr(report_str) 265s 265s if changed_files is not None: 265s current_files = {} 265s 265s for name, content in sorted(self._read_files(tmp_path).items()): 265s if name not in self.files or self.files[name] != content: 265s current_files[name] = content 265s > assert changed_files == current_files 265s E AssertionError: assert {'test_a.py':...napshot(2)\n'} == {} 265s E 265s E Left contains 1 more item: 265s E {'test_a.py': 'from inline_snapshot import snapshot\n' 265s E '\n' 265s E 'def test_a():\n' 265s E ' assert 1 <= snapshot(1)\n' 265s E ' assert 1 == snapshot(2)\n'} 265s E Use -v to get more diff 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_a.py 265s from inline_snapshot import snapshot 265s 265s def test_a(): 265s assert 1 <= snapshot(5) 265s assert 1 == snapshot(2) 265s 265s 265s file: pyproject.toml 265s 265s [tool.inline-snapshot] 265s default-flags = ["trim"] 265s 265s 265s run> /usr/bin/python3.12 -m pytest 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmpo03w_t0r 265s configfile: pyproject.toml 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_a.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s assert 1 <= snapshot(5) 265s > assert 1 == snapshot(2) 265s 265s test_a.py:5: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '1 ', filename = PosixPath('/tmp/tmpo03w_t0r/test_a.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 265s 265s stderr: 265s Traceback (most recent call last): 265s File "", line 198, in _run_module_as_main 265s File "", line 88, in _run_code 265s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 265s raise SystemExit(pytest.console_main()) 265s ^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 265s code = main() 265s ^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 265s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 265s return wrap_session(config, _main) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 265s config.hook.pytest_sessionfinish( 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 265s teardown.send(result) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 265s self.config.hook.pytest_terminal_summary( 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 265s for change in snapshot._changes(): 265s ^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 265s yield from self._value._get_changes() 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s _______________________________ test_config_env ________________________________ 265s 265s def test_config_env(): 265s > Example(file_to_trim).run_pytest( 265s env={"INLINE_SNAPSHOT_DEFAULT_FLAGS": "trim"}, changed_files=trimmed_files 265s ) 265s 265s tests/test_config.py:41: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = [] 265s 265s def run_pytest( 265s self, 265s args: list[str] = [], 265s *, 265s term_columns=80, 265s env: dict[str, str] = {}, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s stderr: Snapshot[str] | None = None, 265s returncode: Snapshot[int] | None = None, 265s ) -> Example: 265s """Run pytest with the given args and env variables in an seperate 265s process. 265s 265s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 265s 265s Parameters: 265s args: pytest arguments like "--inline-snapshot=fix" 265s env: dict of environment variables 265s changed_files: snapshot of files which are changed by this run. 265s report: snapshot of the report at the end of the pytest run. 265s stderr: pytest stderr output 265s returncode: snapshot of the pytest returncode. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s self._write_files(tmp_path) 265s 265s cmd = [sys.executable, "-m", "pytest", *args] 265s 265s command_env = dict(os.environ) 265s command_env["TERM"] = "unknown" 265s command_env["COLUMNS"] = str( 265s term_columns + 1 if platform.system() == "Windows" else term_columns 265s ) 265s command_env.pop("CI", None) 265s 265s command_env.update(env) 265s 265s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 265s 265s print("run>", *cmd) 265s print("stdout:") 265s print(result.stdout.decode()) 265s print("stderr:") 265s print(result.stderr.decode()) 265s 265s if returncode is not None: 265s assert result.returncode == returncode 265s 265s if stderr is not None: 265s assert result.stderr.decode() == stderr 265s 265s if report is not None: 265s 265s report_list = [] 265s record = False 265s for line in result.stdout.decode().splitlines(): 265s line = line.strip() 265s if line.startswith("===="): 265s record = False 265s 265s if record and line: 265s report_list.append(line) 265s 265s if line.startswith("====") and "inline snapshot" in line: 265s record = True 265s 265s report_str = "\n".join(report_list) 265s 265s assert normalize(report_str) == report, repr(report_str) 265s 265s if changed_files is not None: 265s current_files = {} 265s 265s for name, content in sorted(self._read_files(tmp_path).items()): 265s if name not in self.files or self.files[name] != content: 265s current_files[name] = content 265s > assert changed_files == current_files 265s E AssertionError: assert {'test_a.py':...napshot(2)\n'} == {} 265s E 265s E Left contains 1 more item: 265s E {'test_a.py': 'from inline_snapshot import snapshot\n' 265s E '\n' 265s E 'def test_a():\n' 265s E ' assert 1 <= snapshot(1)\n' 265s E ' assert 1 == snapshot(2)\n'} 265s E Use -v to get more diff 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_a.py 265s from inline_snapshot import snapshot 265s 265s def test_a(): 265s assert 1 <= snapshot(5) 265s assert 1 == snapshot(2) 265s 265s 265s run> /usr/bin/python3.12 -m pytest 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmpvtgditap 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_a.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s assert 1 <= snapshot(5) 265s > assert 1 == snapshot(2) 265s 265s test_a.py:5: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '1 ', filename = PosixPath('/tmp/tmpvtgditap/test_a.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 265s 265s stderr: 265s Traceback (most recent call last): 265s File "", line 198, in _run_module_as_main 265s File "", line 88, in _run_code 265s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 265s raise SystemExit(pytest.console_main()) 265s ^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 265s code = main() 265s ^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 265s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 265s return wrap_session(config, _main) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 265s config.hook.pytest_sessionfinish( 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 265s teardown.send(result) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 265s self.config.hook.pytest_terminal_summary( 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 265s for change in snapshot._changes(): 265s ^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 265s yield from self._value._get_changes() 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s ________________________________ test_shortcuts ________________________________ 265s 265s def test_shortcuts(): 265s 265s Example( 265s { 265s **file_to_trim, 265s "pyproject.toml": """ 265s [tool.inline-snapshot.shortcuts] 265s strim=["trim"] 265s """, 265s } 265s > ).run_pytest(["--strim"], changed_files=trimmed_files) 265s 265s tests/test_config.py:56: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = ['--strim'] 265s 265s def run_pytest( 265s self, 265s args: list[str] = [], 265s *, 265s term_columns=80, 265s env: dict[str, str] = {}, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s stderr: Snapshot[str] | None = None, 265s returncode: Snapshot[int] | None = None, 265s ) -> Example: 265s """Run pytest with the given args and env variables in an seperate 265s process. 265s 265s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 265s 265s Parameters: 265s args: pytest arguments like "--inline-snapshot=fix" 265s env: dict of environment variables 265s changed_files: snapshot of files which are changed by this run. 265s report: snapshot of the report at the end of the pytest run. 265s stderr: pytest stderr output 265s returncode: snapshot of the pytest returncode. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s self._write_files(tmp_path) 265s 265s cmd = [sys.executable, "-m", "pytest", *args] 265s 265s command_env = dict(os.environ) 265s command_env["TERM"] = "unknown" 265s command_env["COLUMNS"] = str( 265s term_columns + 1 if platform.system() == "Windows" else term_columns 265s ) 265s command_env.pop("CI", None) 265s 265s command_env.update(env) 265s 265s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 265s 265s print("run>", *cmd) 265s print("stdout:") 265s print(result.stdout.decode()) 265s print("stderr:") 265s print(result.stderr.decode()) 265s 265s if returncode is not None: 265s assert result.returncode == returncode 265s 265s if stderr is not None: 265s assert result.stderr.decode() == stderr 265s 265s if report is not None: 265s 265s report_list = [] 265s record = False 265s for line in result.stdout.decode().splitlines(): 265s line = line.strip() 265s if line.startswith("===="): 265s record = False 265s 265s if record and line: 265s report_list.append(line) 265s 265s if line.startswith("====") and "inline snapshot" in line: 265s record = True 265s 265s report_str = "\n".join(report_list) 265s 265s assert normalize(report_str) == report, repr(report_str) 265s 265s if changed_files is not None: 265s current_files = {} 265s 265s for name, content in sorted(self._read_files(tmp_path).items()): 265s if name not in self.files or self.files[name] != content: 265s current_files[name] = content 265s > assert changed_files == current_files 265s E AssertionError: assert {'test_a.py':...napshot(2)\n'} == {} 265s E 265s E Left contains 1 more item: 265s E {'test_a.py': 'from inline_snapshot import snapshot\n' 265s E '\n' 265s E 'def test_a():\n' 265s E ' assert 1 <= snapshot(1)\n' 265s E ' assert 1 == snapshot(2)\n'} 265s E Use -v to get more diff 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_a.py 265s from inline_snapshot import snapshot 265s 265s def test_a(): 265s assert 1 <= snapshot(5) 265s assert 1 == snapshot(2) 265s 265s 265s file: pyproject.toml 265s 265s [tool.inline-snapshot.shortcuts] 265s strim=["trim"] 265s 265s 265s run> /usr/bin/python3.12 -m pytest --strim 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmpzn76n0yr 265s configfile: pyproject.toml 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_a.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s assert 1 <= snapshot(5) 265s > assert 1 == snapshot(2) 265s 265s test_a.py:5: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '1 ', filename = PosixPath('/tmp/tmpzn76n0yr/test_a.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 265s 265s stderr: 265s Traceback (most recent call last): 265s File "", line 198, in _run_module_as_main 265s File "", line 88, in _run_code 265s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 265s raise SystemExit(pytest.console_main()) 265s ^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 265s code = main() 265s ^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 265s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 265s return wrap_session(config, _main) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 265s config.hook.pytest_sessionfinish( 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 265s teardown.send(result) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 265s self.config.hook.pytest_terminal_summary( 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 265s for change in snapshot._changes(): 265s ^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 265s yield from self._value._get_changes() 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s ____________________________ test_default_shortcuts ____________________________ 265s 265s def test_default_shortcuts(): 265s 265s Example( 265s { 265s **file_to_trim, 265s "pyproject.toml": """ 265s """, 265s } 265s > ).run_pytest( 265s ["--fix"], 265s changed_files=snapshot( 265s { 265s "test_a.py": """\ 265s from inline_snapshot import snapshot 265s 265s def test_a(): 265s assert 1 <= snapshot(5) 265s assert 1 == snapshot(1) 265s """ 265s } 265s ), 265s ) 265s 265s tests/test_config.py:67: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = ['--fix'] 265s 265s def run_pytest( 265s self, 265s args: list[str] = [], 265s *, 265s term_columns=80, 265s env: dict[str, str] = {}, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s stderr: Snapshot[str] | None = None, 265s returncode: Snapshot[int] | None = None, 265s ) -> Example: 265s """Run pytest with the given args and env variables in an seperate 265s process. 265s 265s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 265s 265s Parameters: 265s args: pytest arguments like "--inline-snapshot=fix" 265s env: dict of environment variables 265s changed_files: snapshot of files which are changed by this run. 265s report: snapshot of the report at the end of the pytest run. 265s stderr: pytest stderr output 265s returncode: snapshot of the pytest returncode. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s self._write_files(tmp_path) 265s 265s cmd = [sys.executable, "-m", "pytest", *args] 265s 265s command_env = dict(os.environ) 265s command_env["TERM"] = "unknown" 265s command_env["COLUMNS"] = str( 265s term_columns + 1 if platform.system() == "Windows" else term_columns 265s ) 265s command_env.pop("CI", None) 265s 265s command_env.update(env) 265s 265s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 265s 265s print("run>", *cmd) 265s print("stdout:") 265s print(result.stdout.decode()) 265s print("stderr:") 265s print(result.stderr.decode()) 265s 265s if returncode is not None: 265s assert result.returncode == returncode 265s 265s if stderr is not None: 265s assert result.stderr.decode() == stderr 265s 265s if report is not None: 265s 265s report_list = [] 265s record = False 265s for line in result.stdout.decode().splitlines(): 265s line = line.strip() 265s if line.startswith("===="): 265s record = False 265s 265s if record and line: 265s report_list.append(line) 265s 265s if line.startswith("====") and "inline snapshot" in line: 265s record = True 265s 265s report_str = "\n".join(report_list) 265s 265s assert normalize(report_str) == report, repr(report_str) 265s 265s if changed_files is not None: 265s current_files = {} 265s 265s for name, content in sorted(self._read_files(tmp_path).items()): 265s if name not in self.files or self.files[name] != content: 265s current_files[name] = content 265s > assert changed_files == current_files 265s E AssertionError: assert {'test_a.py':...napshot(1)\n'} == {} 265s E 265s E Left contains 1 more item: 265s E {'test_a.py': 'from inline_snapshot import snapshot\n' 265s E '\n' 265s E 'def test_a():\n' 265s E ' assert 1 <= snapshot(5)\n' 265s E ' assert 1 == snapshot(1)\n'} 265s E Use -v to get more diff 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_a.py 265s from inline_snapshot import snapshot 265s 265s def test_a(): 265s assert 1 <= snapshot(5) 265s assert 1 == snapshot(2) 265s 265s 265s file: pyproject.toml 265s 265s 265s 265s run> /usr/bin/python3.12 -m pytest --fix 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmp752s2tqx 265s configfile: pyproject.toml 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_a.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s assert 1 <= snapshot(5) 265s > assert 1 == snapshot(2) 265s 265s test_a.py:5: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '1 ', filename = PosixPath('/tmp/tmp752s2tqx/test_a.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 265s 265s stderr: 265s Traceback (most recent call last): 265s File "", line 198, in _run_module_as_main 265s File "", line 88, in _run_code 265s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 265s raise SystemExit(pytest.console_main()) 265s ^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 265s code = main() 265s ^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 265s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 265s return wrap_session(config, _main) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 265s config.hook.pytest_sessionfinish( 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 265s teardown.send(result) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 265s self.config.hook.pytest_terminal_summary( 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 265s for change in snapshot._changes(): 265s ^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 265s yield from self._value._get_changes() 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s _______________________ test_compare_dirty_equals_twice ________________________ 265s 265s def test_compare_dirty_equals_twice() -> None: 265s 265s Example( 265s """ 265s from dirty_equals import IsStr 265s from inline_snapshot import snapshot 265s 265s for x in 'ab': 265s assert x == snapshot(IsStr()) 265s assert [x,5] == snapshot([IsStr(),3]) 265s assert {'a':x,'b':5} == snapshot({'a':IsStr(),'b':3}) 265s 265s """ 265s > ).run_inline( 265s ["--inline-snapshot=fix"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s 265s from dirty_equals import IsStr 265s from inline_snapshot import snapshot 265s 265s for x in 'ab': 265s assert x == snapshot(IsStr()) 265s assert [x,5] == snapshot([IsStr(),5]) 265s assert {'a':x,'b':5} == snapshot({'a':IsStr(),'b':5}) 265s 265s """ 265s } 265s ), 265s ) 265s 265s tests/test_dirty_equals.py:47: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = ['--inline-snapshot=fix'] 265s 265s def run_inline( 265s self, 265s args: list[str] = [], 265s *, 265s reported_categories: Snapshot[list[Category]] | None = None, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s raises: Snapshot[str] | None = None, 265s ) -> Example: 265s """Execute the example files in process and run every `test_*` 265s function. 265s 265s This is useful for fast test execution. 265s 265s Parameters: 265s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 265s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 265s changed_files: snapshot of files which are changed by this run. 265s raises: snapshot of the exception which is raised during the test execution. 265s It is required if your code raises an exception. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s parser = ArgumentParser() 265s 265s parser.add_argument( 265s "--inline-snapshot", 265s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 265s dest="inline_snapshot", 265s help="update specific snapshot values:\n" 265s "disable: disable the snapshot logic\n" 265s "short-report: show a short report\n" 265s "report: show a longer report with a diff report\n" 265s "review: allow to approve the changes interactive\n" 265s "create: creates snapshots which are currently not defined\n" 265s "update: update snapshots even if they are defined\n" 265s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 265s "fix: change snapshots which currently break your tests\n", 265s ) 265s parsed_args = parser.parse_args(args) 265s flags = (parsed_args.inline_snapshot or "").split(",") 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s 265s self._write_files(tmp_path) 265s 265s raised_exception = None 265s with snapshot_env(): 265s with ChangeRecorder().activate() as recorder: 265s _inline_snapshot._update_flags = Flags({*flags}) 265s inline_snapshot._external.storage = ( 265s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 265s ) 265s 265s try: 265s for filename in tmp_path.glob("*.py"): 265s globals: dict[str, Any] = {} 265s print("run> pytest", filename) 265s exec( 265s compile(filename.read_text("utf-8"), filename, "exec"), 265s globals, 265s ) 265s 265s # run all test_* functions 265s for k, v in globals.items(): 265s if k.startswith("test_") and callable(v): 265s v() 265s except Exception as e: 265s traceback.print_exc() 265s raised_exception = e 265s 265s finally: 265s _inline_snapshot._active = False 265s 265s changes = [] 265s for snapshot in _inline_snapshot.snapshots.values(): 265s changes += snapshot._changes() 265s 265s snapshot_flags = {change.flag for change in changes} 265s 265s apply_all( 265s [ 265s change 265s for change in changes 265s if change.flag in _inline_snapshot._update_flags.to_set() 265s ] 265s ) 265s recorder.fix_all() 265s 265s report_output = StringIO() 265s console = Console(file=report_output) 265s 265s # TODO: add all the report output here 265s report_problems(console) 265s 265s if reported_categories is not None: 265s assert sorted(snapshot_flags) == reported_categories 265s 265s if raised_exception is not None: 265s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 265s raised_exception 265s ) 265s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 265s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s 265s from dirty_equals import IsStr 265s from inline_snapshot import snapshot 265s 265s for x in 'ab': 265s assert x == snapshot(IsStr()) 265s assert [x,5] == snapshot([IsStr(),3]) 265s assert {'a':x,'b':5} == snapshot({'a':IsStr(),'b':3}) 265s 265s 265s 265s run> pytest /tmp/tmpilhbrlp4/test_something.py 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 185, in run_inline 265s exec( 265s File "/tmp/tmpilhbrlp4/test_something.py", line 7, in 265s assert [x,5] == snapshot([IsStr(),3]) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 265s return self == other 265s ^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 265s self._changes.append(next(it)) 265s ^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py", line 79, in assign 265s v = yield from self.get_adapter( 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 265s new_code = self.context.file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s _____________________ test_dirty_equals_with_changing_args _____________________ 265s 265s def test_dirty_equals_with_changing_args() -> None: 265s 265s Example( 265s """\ 265s from dirty_equals import IsInt 265s from inline_snapshot import snapshot 265s 265s def test_number(): 265s 265s for i in range(5): 265s assert ["a",i] == snapshot(["e",IsInt(gt=i-1,lt=i+1)]) 265s 265s """ 265s > ).run_inline( 265s ["--inline-snapshot=fix"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s from dirty_equals import IsInt 265s from inline_snapshot import snapshot 265s 265s def test_number(): 265s 265s for i in range(5): 265s assert ["a",i] == snapshot(["a",IsInt(gt=i-1,lt=i+1)]) 265s 265s """ 265s } 265s ), 265s ) 265s 265s tests/test_dirty_equals.py:138: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = ['--inline-snapshot=fix'] 265s 265s def run_inline( 265s self, 265s args: list[str] = [], 265s *, 265s reported_categories: Snapshot[list[Category]] | None = None, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s raises: Snapshot[str] | None = None, 265s ) -> Example: 265s """Execute the example files in process and run every `test_*` 265s function. 265s 265s This is useful for fast test execution. 265s 265s Parameters: 265s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 265s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 265s changed_files: snapshot of files which are changed by this run. 265s raises: snapshot of the exception which is raised during the test execution. 265s It is required if your code raises an exception. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s parser = ArgumentParser() 265s 265s parser.add_argument( 265s "--inline-snapshot", 265s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 265s dest="inline_snapshot", 265s help="update specific snapshot values:\n" 265s "disable: disable the snapshot logic\n" 265s "short-report: show a short report\n" 265s "report: show a longer report with a diff report\n" 265s "review: allow to approve the changes interactive\n" 265s "create: creates snapshots which are currently not defined\n" 265s "update: update snapshots even if they are defined\n" 265s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 265s "fix: change snapshots which currently break your tests\n", 265s ) 265s parsed_args = parser.parse_args(args) 265s flags = (parsed_args.inline_snapshot or "").split(",") 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s 265s self._write_files(tmp_path) 265s 265s raised_exception = None 265s with snapshot_env(): 265s with ChangeRecorder().activate() as recorder: 265s _inline_snapshot._update_flags = Flags({*flags}) 265s inline_snapshot._external.storage = ( 265s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 265s ) 265s 265s try: 265s for filename in tmp_path.glob("*.py"): 265s globals: dict[str, Any] = {} 265s print("run> pytest", filename) 265s exec( 265s compile(filename.read_text("utf-8"), filename, "exec"), 265s globals, 265s ) 265s 265s # run all test_* functions 265s for k, v in globals.items(): 265s if k.startswith("test_") and callable(v): 265s v() 265s except Exception as e: 265s traceback.print_exc() 265s raised_exception = e 265s 265s finally: 265s _inline_snapshot._active = False 265s 265s changes = [] 265s for snapshot in _inline_snapshot.snapshots.values(): 265s changes += snapshot._changes() 265s 265s snapshot_flags = {change.flag for change in changes} 265s 265s apply_all( 265s [ 265s change 265s for change in changes 265s if change.flag in _inline_snapshot._update_flags.to_set() 265s ] 265s ) 265s recorder.fix_all() 265s 265s report_output = StringIO() 265s console = Console(file=report_output) 265s 265s # TODO: add all the report output here 265s report_problems(console) 265s 265s if reported_categories is not None: 265s assert sorted(snapshot_flags) == reported_categories 265s 265s if raised_exception is not None: 265s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 265s raised_exception 265s ) 265s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 265s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from dirty_equals import IsInt 265s from inline_snapshot import snapshot 265s 265s def test_number(): 265s 265s for i in range(5): 265s assert ["a",i] == snapshot(["e",IsInt(gt=i-1,lt=i+1)]) 265s 265s 265s 265s run> pytest /tmp/tmp2m4zo407/test_something.py 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 265s v() 265s File "/tmp/tmp2m4zo407/test_something.py", line 7, in test_number 265s assert ["a",i] == snapshot(["e",IsInt(gt=i-1,lt=i+1)]) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 265s return self == other 265s ^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 265s self._changes.append(next(it)) 265s ^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py", line 79, in assign 265s v = yield from self.get_adapter( 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 265s new_code = self.context.file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s _________________________________ test_example _________________________________ 265s 265s def test_example(): 265s 265s e = Example( 265s { 265s "test_a.py": """ 265s from inline_snapshot import snapshot 265s 265s def test_a(): 265s assert 1==snapshot(2) 265s """, 265s "test_b.py": "1+1", 265s }, 265s ) 265s 265s e.run_pytest( 265s ["--inline-snapshot=create,fix"], 265s ) 265s 265s > e.run_inline( 265s ["--inline-snapshot=fix"], 265s reported_categories=snapshot(["fix"]), 265s ).run_inline( 265s ["--inline-snapshot=fix"], 265s changed_files=snapshot({}), 265s ) 265s 265s tests/test_example.py:23: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = ['--inline-snapshot=fix'] 265s 265s def run_inline( 265s self, 265s args: list[str] = [], 265s *, 265s reported_categories: Snapshot[list[Category]] | None = None, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s raises: Snapshot[str] | None = None, 265s ) -> Example: 265s """Execute the example files in process and run every `test_*` 265s function. 265s 265s This is useful for fast test execution. 265s 265s Parameters: 265s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 265s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 265s changed_files: snapshot of files which are changed by this run. 265s raises: snapshot of the exception which is raised during the test execution. 265s It is required if your code raises an exception. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s parser = ArgumentParser() 265s 265s parser.add_argument( 265s "--inline-snapshot", 265s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 265s dest="inline_snapshot", 265s help="update specific snapshot values:\n" 265s "disable: disable the snapshot logic\n" 265s "short-report: show a short report\n" 265s "report: show a longer report with a diff report\n" 265s "review: allow to approve the changes interactive\n" 265s "create: creates snapshots which are currently not defined\n" 265s "update: update snapshots even if they are defined\n" 265s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 265s "fix: change snapshots which currently break your tests\n", 265s ) 265s parsed_args = parser.parse_args(args) 265s flags = (parsed_args.inline_snapshot or "").split(",") 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s 265s self._write_files(tmp_path) 265s 265s raised_exception = None 265s with snapshot_env(): 265s with ChangeRecorder().activate() as recorder: 265s _inline_snapshot._update_flags = Flags({*flags}) 265s inline_snapshot._external.storage = ( 265s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 265s ) 265s 265s try: 265s for filename in tmp_path.glob("*.py"): 265s globals: dict[str, Any] = {} 265s print("run> pytest", filename) 265s exec( 265s compile(filename.read_text("utf-8"), filename, "exec"), 265s globals, 265s ) 265s 265s # run all test_* functions 265s for k, v in globals.items(): 265s if k.startswith("test_") and callable(v): 265s v() 265s except Exception as e: 265s traceback.print_exc() 265s raised_exception = e 265s 265s finally: 265s _inline_snapshot._active = False 265s 265s changes = [] 265s for snapshot in _inline_snapshot.snapshots.values(): 265s changes += snapshot._changes() 265s 265s snapshot_flags = {change.flag for change in changes} 265s 265s apply_all( 265s [ 265s change 265s for change in changes 265s if change.flag in _inline_snapshot._update_flags.to_set() 265s ] 265s ) 265s recorder.fix_all() 265s 265s report_output = StringIO() 265s console = Console(file=report_output) 265s 265s # TODO: add all the report output here 265s report_problems(console) 265s 265s if reported_categories is not None: 265s > assert sorted(snapshot_flags) == reported_categories 265s E AssertionError: assert [] == ['fix'] 265s E 265s E Right contains one more item: 'fix' 265s E Use -v to get more diff 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:223: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_a.py 265s 265s from inline_snapshot import snapshot 265s 265s def test_a(): 265s assert 1==snapshot(2) 265s 265s 265s file: test_b.py 265s 1+1 265s 265s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create,fix 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmpnxfxoa6f 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_a.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s > assert 1==snapshot(2) 265s 265s test_a.py:5: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '1 ', filename = PosixPath('/tmp/tmpnxfxoa6f/test_a.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 265s ============================== 1 failed in 0.24s =============================== 265s 265s stderr: 265s 265s file: test_b.py 265s 1+1 265s 265s file: test_a.py 265s 265s from inline_snapshot import snapshot 265s 265s def test_a(): 265s assert 1==snapshot(2) 265s 265s 265s run> pytest /tmp/tmp80_07w_c/test_b.py 265s run> pytest /tmp/tmp80_07w_c/test_a.py 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 265s v() 265s File "/tmp/tmp80_07w_c/test_a.py", line 5, in test_a 265s assert 1==snapshot(2) 265s ^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 265s return self == other 265s ^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 265s self._changes.append(next(it)) 265s ^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 265s new_code = self.context.file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s __________________________________ test_basic __________________________________ 265s 265s check_update = .w at 0x611fc2968680> 265s 265s def test_basic(check_update): 265s > assert check_update( 265s "assert outsource('text') == snapshot()", flags="create" 265s ) == snapshot( 265s "assert outsource('text') == snapshot(external(\"982d9e3eb996*.txt\"))" 265s ) 265s 265s tests/test_external.py:12: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_basic0/test_1.py:9: in 265s assert outsource('text') == snapshot() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_basic0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert outsource('text') == snapshot() 265s _________________________________ test_persist _________________________________ 265s 265s project = .Project object at 0x611fc27e2c30> 265s 265s def test_persist(project): 265s 265s project.setup( 265s """\ 265s from inline_snapshot import external 265s 265s def test_something(): 265s assert "hello" == snapshot(external("bbbbb*.txt")) 265s assert 2 == snapshot(1+1) 265s """ 265s ) 265s 265s result = project.run("--inline-snapshot=update") 265s 265s assert project.storage() == snapshot([]) 265s 265s > assert project.source == snapshot( 265s """\ 265s from inline_snapshot import external 265s 265s def test_something(): 265s assert "hello" == snapshot(external("bbbbb*.txt")) 265s assert 2 == snapshot(2) 265s """ 265s ) 265s 265s /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_external.py:78: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '"""\\\nfrom inline_snapshot import external\n\ndef test_something():\n assert "hello" == snapshot(external("bbbbb*.txt"))\n assert 2 == snapshot(1+1)\n"""' 265s filename = PosixPath('/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_external.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s write code: 265s # äöß 🐍 265s from inline_snapshot import snapshot 265s from inline_snapshot import outsource 265s from inline_snapshot import external 265s 265s def test_something(): 265s assert "hello" == snapshot(external("bbbbb*.txt")) 265s assert 2 == snapshot(1+1) 265s 265s running: pytest --inline-snapshot=update 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_persist0 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_persist0 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_file.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ________________________________ test_something ________________________________ 265s 265s def test_something(): 265s > assert "hello" == snapshot(external("bbbbb*.txt")) 265s 265s test_file.py:7: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = "'hello'" 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_persist0/test_file.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_file.py::test_something - TypeError: CliRunner.__init__() got an ... 265s ============================== 1 failed in 0.46s =============================== 265s _________________________ test_pytest_compare_external _________________________ 265s 265s project = .Project object at 0x611fc2599730> 265s 265s def test_pytest_compare_external(project): 265s project.setup( 265s """\ 265s from inline_snapshot import external 265s 265s def test_a(): 265s assert outsource("test") == snapshot( 265s external("9f86d081884c*.txt") 265s ) 265s 265s assert outsource("test2") == snapshot( 265s external("9f86d081884c*.txt") 265s ) 265s """ 265s ) 265s 265s result = project.run() 265s 265s > assert result.errorLines() == snapshot( 265s """\ 265s > assert outsource("test2") == snapshot( 265s E AssertionError: assert 'test2' == 'test' 265s E ⏎ 265s E - test 265s E + test2 265s E ? + 265s """ 265s ) 265s 265s /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_external.py:123: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '"""\\\n> assert outsource("test2") == snapshot(\n> runner = CliRunner(mix_stderr=False)\nE TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\n"""' 265s filename = PosixPath('/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_external.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s write code: 265s # äöß 🐍 265s from inline_snapshot import snapshot 265s from inline_snapshot import outsource 265s from inline_snapshot import external 265s 265s def test_a(): 265s assert outsource("test") == snapshot( 265s external("9f86d081884c*.txt") 265s ) 265s 265s assert outsource("test2") == snapshot( 265s external("9f86d081884c*.txt") 265s ) 265s 265s running: pytest 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external0 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external0 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_file.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s assert outsource("test") == snapshot( 265s external("9f86d081884c*.txt") 265s ) 265s 265s > assert outsource("test2") == snapshot( 265s external("9f86d081884c*.txt") 265s ) 265s 265s test_file.py:11: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = 'external ("60303ae22b99*.txt")' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external0/test_file.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 265s ============================== 1 failed in 0.31s =============================== 265s ______________________ test_pytest_compare_external_bytes ______________________ 265s 265s project = .Project object at 0x611fc259bf20> 265s 265s def test_pytest_compare_external_bytes(project): 265s project.setup( 265s """\ 265s from inline_snapshot import external 265s 265s def test_a(): 265s assert outsource(b"test") == snapshot( 265s external("9f86d081884c*.bin") 265s ) 265s 265s assert outsource(b"test2") == snapshot( 265s external("9f86d081884c*.bin") 265s ) 265s """ 265s ) 265s 265s result = project.run() 265s 265s > assert result.errorLines() == snapshot( 265s """\ 265s > assert outsource(b"test2") == snapshot( 265s E AssertionError: assert b'test2' == b'test' 265s E ⏎ 265s E Use -v to get more diff 265s """ 265s ) 265s 265s /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_external.py:153: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s 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"""' 265s filename = PosixPath('/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_external.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s write code: 265s # äöß 🐍 265s from inline_snapshot import snapshot 265s from inline_snapshot import outsource 265s from inline_snapshot import external 265s 265s def test_a(): 265s assert outsource(b"test") == snapshot( 265s external("9f86d081884c*.bin") 265s ) 265s 265s assert outsource(b"test2") == snapshot( 265s external("9f86d081884c*.bin") 265s ) 265s 265s running: pytest 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external_bytes0 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external_bytes0 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_file.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s assert outsource(b"test") == snapshot( 265s external("9f86d081884c*.bin") 265s ) 265s 265s > assert outsource(b"test2") == snapshot( 265s external("9f86d081884c*.bin") 265s ) 265s 265s test_file.py:11: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = 'external ("60303ae22b99*.bin")' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external_bytes0/test_file.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 265s ============================== 1 failed in 0.37s =============================== 265s _____________________ test_pytest_existing_external_import _____________________ 265s 265s project = .Project object at 0x611fc259b470> 265s 265s def test_pytest_existing_external_import(project): 265s project.setup( 265s """\ 265s from inline_snapshot import external 265s 265s def test_a(): 265s assert outsource("test") == snapshot() 265s """ 265s ) 265s 265s result = project.run("--inline-snapshot=create") 265s 265s > assert project.source == snapshot( 265s """\ 265s from inline_snapshot import external 265s 265s def test_a(): 265s assert outsource("test") == snapshot(external("9f86d081884c*.txt")) 265s """ 265s ) 265s 265s /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_external.py:175: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '"""\\\nfrom inline_snapshot import external\n\ndef test_a():\n assert outsource("test") == snapshot()\n"""' 265s filename = PosixPath('/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_external.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s write code: 265s # äöß 🐍 265s from inline_snapshot import snapshot 265s from inline_snapshot import outsource 265s from inline_snapshot import external 265s 265s def test_a(): 265s assert outsource("test") == snapshot() 265s 265s running: pytest --inline-snapshot=create 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_existing_external_import0 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_existing_external_import0 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_file.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s > assert outsource("test") == snapshot() 265s 265s test_file.py:7: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_existing_external_import0/test_file.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 265s ============================== 1 failed in 0.31s =============================== 265s __________________________ test_pytest_trim_external ___________________________ 265s 265s project = .Project object at 0x611fc25c6ff0> 265s 265s def test_pytest_trim_external(project): 265s project.setup( 265s """\ 265s def test_a(): 265s assert outsource("test") == snapshot() 265s 265s # split 265s 265s assert outsource("test2") == snapshot() 265s """ 265s ) 265s 265s project.run("--inline-snapshot=create") 265s 265s > assert project.storage() == snapshot( 265s [ 265s "60303ae22b998861bce3b28f33eec1be758a213c86c93c076dbe9f558c11c752.txt", 265s "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08.txt", 265s ] 265s ) 265s 265s /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_external.py:199: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = "'9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08-new.txt'" 265s filename = PosixPath('/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_external.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s write code: 265s # äöß 🐍 265s from inline_snapshot import snapshot 265s from inline_snapshot import outsource 265s 265s 265s def test_a(): 265s assert outsource("test") == snapshot() 265s 265s # split 265s 265s assert outsource("test2") == snapshot() 265s 265s running: pytest --inline-snapshot=create 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_trim_external0 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_trim_external0 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_file.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s > assert outsource("test") == snapshot() 265s 265s test_file.py:7: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_trim_external0/test_file.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 265s ============================== 1 failed in 0.31s =============================== 265s ___________________________ test_pytest_new_external ___________________________ 265s 265s project = .Project object at 0x611fc25c6de0> 265s 265s def test_pytest_new_external(project): 265s project.setup( 265s """\ 265s def test_a(): 265s assert outsource("test") == snapshot() 265s """ 265s ) 265s project.run() 265s 265s assert project.storage() == snapshot( 265s ["9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08-new.txt"] 265s ) 265s 265s project.run("--inline-snapshot=create") 265s 265s > assert project.storage() == snapshot( 265s ["9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08.txt"] 265s ) 265s 265s /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_external.py:255: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = "'9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08-new.txt'" 265s filename = PosixPath('/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_external.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s write code: 265s # äöß 🐍 265s from inline_snapshot import snapshot 265s from inline_snapshot import outsource 265s 265s 265s def test_a(): 265s assert outsource("test") == snapshot() 265s 265s running: pytest 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_file.py FE [100%] 265s 265s ==================================== ERRORS ==================================== 265s _________________________ ERROR at teardown of test_a __________________________ 265s your snapshot is missing one value. 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s > assert outsource("test") == snapshot() 265s 265s test_file.py:7: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0/test_file.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 265s ERROR test_file.py::test_a - Failed: your snapshot is missing one value. 265s ========================== 1 failed, 1 error in 0.32s ========================== 265s running: pytest --inline-snapshot=create 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_file.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s > assert outsource("test") == snapshot() 265s 265s test_file.py:7: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0/test_file.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 265s ============================== 1 failed in 0.31s =============================== 265s ________________________ test_pytest_config_hash_length ________________________ 265s 265s project = .Project object at 0x611fc267b800> 265s 265s def test_pytest_config_hash_length(project): 265s project.setup( 265s """\ 265s def test_a(): 265s assert outsource("test") == snapshot() 265s """ 265s ) 265s project.run("--inline-snapshot=create") 265s default_result = project.source 265s 265s # default config 265s project.pyproject( 265s """ 265s [tool.inline-snapshot] 265s """ 265s ) 265s project.run("--inline-snapshot=create") 265s assert default_result == project.source 265s 265s # set hash_length 265s project.pyproject( 265s """ 265s [tool.inline-snapshot] 265s hash-length=5 265s """ 265s ) 265s project.run("--inline-snapshot=create") 265s > assert project.source == snapshot( 265s """\ 265s from inline_snapshot import external 265s 265s 265s def test_a(): 265s assert outsource("test") == snapshot(external("9f86d081884c*.txt")) 265s """ 265s ) 265s 265s /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_external.py:287: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '"""\\\ndef test_a():\n assert outsource("test") == snapshot()\n"""' 265s filename = PosixPath('/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_external.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s write code: 265s # äöß 🐍 265s from inline_snapshot import snapshot 265s from inline_snapshot import outsource 265s 265s 265s def test_a(): 265s assert outsource("test") == snapshot() 265s 265s running: pytest --inline-snapshot=create 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_file.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s > assert outsource("test") == snapshot() 265s 265s test_file.py:7: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0/test_file.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 265s ============================== 1 failed in 0.31s =============================== 265s running: pytest --inline-snapshot=create 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 265s configfile: pyproject.toml 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_file.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s > assert outsource("test") == snapshot() 265s 265s test_file.py:7: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0/test_file.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 265s ============================== 1 failed in 0.38s =============================== 265s running: pytest --inline-snapshot=create 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 265s configfile: pyproject.toml 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_file.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s > assert outsource("test") == snapshot() 265s 265s test_file.py:7: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0/test_file.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 265s ============================== 1 failed in 0.33s =============================== 265s _______________________________ test_no_imports ________________________________ 265s 265s project = .Project object at 0x611fc2628800> 265s 265s def test_no_imports(project): 265s project.setup( 265s """\ 265s # no imports 265s 265s def test_something(): 265s from inline_snapshot import outsource,snapshot 265s assert outsource("test") == snapshot() 265s test_something() 265s """ 265s ) 265s 265s result = project.run("--inline-snapshot=create") 265s 265s > result.assert_outcomes(passed=1) 265s E AssertionError: assert {'errors': 1,...pped': 0, ...} == {'errors': 0,...pped': 0, ...} 265s E 265s E Omitting 4 identical items, use -vv to show 265s E Differing items: 265s E {'errors': 1} != {'errors': 0} 265s E {'passed': 0} != {'passed': 1} 265s E Use -v to get more diff 265s 265s /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_external.py:340: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s write code: 265s # äöß 🐍 265s 265s 265s # no imports 265s 265s def test_something(): 265s from inline_snapshot import outsource,snapshot 265s assert outsource("test") == snapshot() 265s test_something() 265s 265s running: pytest --inline-snapshot=create 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_no_imports0 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_no_imports0 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 0 items / 1 error 265s 265s ==================================== ERRORS ==================================== 265s ________________________ ERROR collecting test_file.py _________________________ 265s test_file.py:9: in 265s test_something() 265s test_file.py:8: in test_something 265s assert outsource("test") == snapshot() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 265s runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s ERROR test_file.py - TypeError: CliRunner.__init__() got an unexpected keywor... 265s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 265s =============================== 1 error in 0.29s =============================== 265s _____________________________ test_ensure_imports ______________________________ 265s 265s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_ensure_imports0') 265s 265s def test_ensure_imports(tmp_path): 265s file = tmp_path / "file.py" 265s file.write_text( 265s """\ 265s from os import environ 265s from os import getcwd 265s """, 265s "utf-8", 265s ) 265s 265s > with apply_changes(): 265s 265s tests/test_external.py:372: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3.12/contextlib.py:144: in __exit__ 265s next(self.gen) 265s tests/utils.py:32: in apply_changes 265s recorder.fix_all() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 265s file.rewrite() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 265s new_code = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = 'from os import environ\nfrom os import getcwd\n' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_ensure_imports0/file.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s _______________________ test_ensure_imports_with_comment _______________________ 265s 265s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_ensure_imports_with_comme0') 265s 265s def test_ensure_imports_with_comment(tmp_path): 265s file = tmp_path / "file.py" 265s file.write_text( 265s """\ 265s from os import environ # comment 265s """, 265s "utf-8", 265s ) 265s 265s > with apply_changes(): 265s 265s tests/test_external.py:394: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3.12/contextlib.py:144: in __exit__ 265s next(self.gen) 265s tests/utils.py:32: in apply_changes 265s recorder.fix_all() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 265s file.rewrite() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 265s new_code = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = 'from os import environ # comment\n' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_ensure_imports_with_comme0/file.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ______________________________ test_new_externals ______________________________ 265s 265s project = .Project object at 0x611fc262aab0> 265s 265s def test_new_externals(project): 265s project.setup( 265s """ 265s 265s def test_something(): 265s outsource("blub") 265s 265s assert outsource("foo") == snapshot() 265s 265s """ 265s ) 265s 265s project.run("--inline-snapshot=create") 265s 265s > assert project.storage() == snapshot( 265s [ 265s "2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae.txt", 265s "8dc140e6fe831481a2005ae152ffe32a9974aa92a260dfbac780d6a87154bb0b-new.txt", 265s ] 265s ) 265s 265s /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_external.py:420: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = "'2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae-new.txt'" 265s filename = PosixPath('/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_external.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s write code: 265s # äöß 🐍 265s from inline_snapshot import snapshot 265s from inline_snapshot import outsource 265s 265s 265s 265s 265s def test_something(): 265s outsource("blub") 265s 265s assert outsource("foo") == snapshot() 265s 265s 265s running: pytest --inline-snapshot=create 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_new_externals0 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_new_externals0 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_file.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ________________________________ test_something ________________________________ 265s 265s def test_something(): 265s outsource("blub") 265s 265s > assert outsource("foo") == snapshot() 265s 265s test_file.py:11: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_new_externals0/test_file.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_file.py::test_something - TypeError: CliRunner.__init__() got an ... 265s ============================== 1 failed in 0.30s =============================== 265s _________________________ test_black_formatting_error __________________________ 265s 265s mocker = 265s 265s def test_black_formatting_error(mocker): 265s mocker.patch.object(CliRunner, "invoke", return_value=SimpleNamespace(exit_code=1)) 265s 265s Example( 265s """\ 265s from inline_snapshot import snapshot 265s 265s def test_something(): 265s assert 1==snapshot() 265s assert 1==snapshot(2) 265s assert list(range(20)) == snapshot() 265s """ 265s > ).run_inline( 265s ["--inline-snapshot=fix,create"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s from inline_snapshot import snapshot 265s 265s def test_something(): 265s assert 1==snapshot(1) 265s assert 1==snapshot(1) 265s 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 ]) 265s """ 265s } 265s ), 265s report=snapshot( 265s """\ 265s ----------------------------------- Problems ----------------------------------- 265s black could not format your code, which might be caused by this issue: 265s https://github.com/15r10nk/inline-snapshot/issues/138 265s 265s """ 265s ), 265s ) 265s 265s tests/test_formating.py:24: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = ['--inline-snapshot=fix,create'] 265s 265s def run_inline( 265s self, 265s args: list[str] = [], 265s *, 265s reported_categories: Snapshot[list[Category]] | None = None, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s raises: Snapshot[str] | None = None, 265s ) -> Example: 265s """Execute the example files in process and run every `test_*` 265s function. 265s 265s This is useful for fast test execution. 265s 265s Parameters: 265s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 265s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 265s changed_files: snapshot of files which are changed by this run. 265s raises: snapshot of the exception which is raised during the test execution. 265s It is required if your code raises an exception. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s parser = ArgumentParser() 265s 265s parser.add_argument( 265s "--inline-snapshot", 265s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 265s dest="inline_snapshot", 265s help="update specific snapshot values:\n" 265s "disable: disable the snapshot logic\n" 265s "short-report: show a short report\n" 265s "report: show a longer report with a diff report\n" 265s "review: allow to approve the changes interactive\n" 265s "create: creates snapshots which are currently not defined\n" 265s "update: update snapshots even if they are defined\n" 265s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 265s "fix: change snapshots which currently break your tests\n", 265s ) 265s parsed_args = parser.parse_args(args) 265s flags = (parsed_args.inline_snapshot or "").split(",") 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s 265s self._write_files(tmp_path) 265s 265s raised_exception = None 265s with snapshot_env(): 265s with ChangeRecorder().activate() as recorder: 265s _inline_snapshot._update_flags = Flags({*flags}) 265s inline_snapshot._external.storage = ( 265s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 265s ) 265s 265s try: 265s for filename in tmp_path.glob("*.py"): 265s globals: dict[str, Any] = {} 265s print("run> pytest", filename) 265s exec( 265s compile(filename.read_text("utf-8"), filename, "exec"), 265s globals, 265s ) 265s 265s # run all test_* functions 265s for k, v in globals.items(): 265s if k.startswith("test_") and callable(v): 265s v() 265s except Exception as e: 265s traceback.print_exc() 265s raised_exception = e 265s 265s finally: 265s _inline_snapshot._active = False 265s 265s changes = [] 265s for snapshot in _inline_snapshot.snapshots.values(): 265s changes += snapshot._changes() 265s 265s snapshot_flags = {change.flag for change in changes} 265s 265s apply_all( 265s [ 265s change 265s for change in changes 265s if change.flag in _inline_snapshot._update_flags.to_set() 265s ] 265s ) 265s recorder.fix_all() 265s 265s report_output = StringIO() 265s console = Console(file=report_output) 265s 265s # TODO: add all the report output here 265s report_problems(console) 265s 265s if reported_categories is not None: 265s assert sorted(snapshot_flags) == reported_categories 265s 265s if raised_exception is not None: 265s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 265s raised_exception 265s ) 265s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 265s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot 265s 265s def test_something(): 265s assert 1==snapshot() 265s assert 1==snapshot(2) 265s assert list(range(20)) == snapshot() 265s 265s 265s run> pytest /tmp/tmpcxtuncuf/test_something.py 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 265s v() 265s File "/tmp/tmpcxtuncuf/test_something.py", line 4, in test_something 265s assert 1==snapshot() 265s ^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 265s return self == other 265s ^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 265s self._changes.append(next(it)) 265s ^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 265s new_code = self.context.file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s _______________________________ test_fstring_139 _______________________________ 265s 265s def test_fstring_139(): 265s Example( 265s """ 265s from inline_snapshot import snapshot 265s snapshot(f'') 265s snapshot(rf'') 265s snapshot(Rf'') 265s snapshot(F'') 265s snapshot(rF'') 265s snapshot(RF'') 265s 265s 265s def test_a(): 265s return None 265s """ 265s > ).run_pytest(returncode=0) 265s 265s tests/test_formating.py:64: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = [] 265s 265s def run_pytest( 265s self, 265s args: list[str] = [], 265s *, 265s term_columns=80, 265s env: dict[str, str] = {}, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s stderr: Snapshot[str] | None = None, 265s returncode: Snapshot[int] | None = None, 265s ) -> Example: 265s """Run pytest with the given args and env variables in an seperate 265s process. 265s 265s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 265s 265s Parameters: 265s args: pytest arguments like "--inline-snapshot=fix" 265s env: dict of environment variables 265s changed_files: snapshot of files which are changed by this run. 265s report: snapshot of the report at the end of the pytest run. 265s stderr: pytest stderr output 265s returncode: snapshot of the pytest returncode. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s self._write_files(tmp_path) 265s 265s cmd = [sys.executable, "-m", "pytest", *args] 265s 265s command_env = dict(os.environ) 265s command_env["TERM"] = "unknown" 265s command_env["COLUMNS"] = str( 265s term_columns + 1 if platform.system() == "Windows" else term_columns 265s ) 265s command_env.pop("CI", None) 265s 265s command_env.update(env) 265s 265s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 265s 265s print("run>", *cmd) 265s print("stdout:") 265s print(result.stdout.decode()) 265s print("stderr:") 265s print(result.stderr.decode()) 265s 265s if returncode is not None: 265s > assert result.returncode == returncode 265s E AssertionError: assert 1 == 0 265s 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 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:297: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s 265s from inline_snapshot import snapshot 265s snapshot(f'') 265s snapshot(rf'') 265s snapshot(Rf'') 265s snapshot(F'') 265s snapshot(rF'') 265s snapshot(RF'') 265s 265s 265s def test_a(): 265s return None 265s 265s 265s run> /usr/bin/python3.12 -m pytest 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmpz2r0jo25 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_something.py . [100%] 265s =============================== inline snapshot ================================ 265s 265s stderr: 265s Traceback (most recent call last): 265s File "", line 198, in _run_module_as_main 265s File "", line 88, in _run_code 265s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 265s raise SystemExit(pytest.console_main()) 265s ^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 265s code = main() 265s ^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 265s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 265s return wrap_session(config, _main) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 265s config.hook.pytest_sessionfinish( 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 265s teardown.send(result) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 265s self.config.hook.pytest_terminal_summary( 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 265s for change in snapshot._changes(): 265s ^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 265s yield from self._value._get_changes() 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 218, in _get_changes 265s yield from handle(self._ast_node, self._old_value) 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 206, in handle 265s new_code = self._file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s _______________ test_generic[executing] [assert 4 == snapshot()] _______________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_1.py:9: in 265s assert 4 == snapshot() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 4 == snapshot() 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________ test_generic[executing] [assert 4 == snapshot({})[0]] _____________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_2.py:9: in 265s assert 4 == snapshot({})[0] 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_2.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 4 == snapshot({})[0] 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic[executing] [assert 4 == snapshot(5)] _______________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_3.py:9: in 265s assert 4 == snapshot(5) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_3.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 4 == snapshot(5) 265s ------------------------------ Captured log call ------------------------------- 265s 265s __________ test_generic[executing] [assert 4 == snapshot({0: 5})[0]] ___________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_4.py:9: in 265s assert 4 == snapshot({0: 5})[0] 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_4.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 4 == snapshot({0: 5})[0] 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____________ test_generic[executing] [assert 4 == snapshot(2+2)] ______________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_5.py:9: in 265s assert 4 == snapshot(2+2) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_5.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 4 == snapshot(2+2) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _________ test_generic[executing] [assert 4 == snapshot({0: 2+2})[0]] __________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_6.py:9: in 265s assert 4 == snapshot({0: 2+2})[0] 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_6.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 4 == snapshot({0: 2+2})[0] 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic[executing] [assert 4 <= snapshot()] _______________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 265s new_code = self._value._new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 265s return self._file._value_to_code(self._new_value) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_7.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 4 <= snapshot() 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________ test_generic[executing] [assert 4 <= snapshot({})[0]] _____________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 265s to_insert.append((key, new_value_element._new_code())) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 265s return self._file._value_to_code(self._new_value) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_8.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 4 <= snapshot({})[0] 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic[executing] [assert 4 <= snapshot(5)] _______________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_9.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 4 <= snapshot(5) 265s ------------------------------ Captured log call ------------------------------- 265s 265s __________ test_generic[executing] [assert 4 <= snapshot({0: 5})[0]] ___________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_10.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 4 <= snapshot({0: 5})[0] 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic[executing] [assert 5 <= snapshot(4)] _______________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_11.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 <= snapshot(4) 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_11.py", line 9, in 265s assert 5 <= snapshot(4) 265s ^^^^^^^^^^^^^^^^ 265s AssertionError 265s ------------------------------ Captured log call ------------------------------- 265s 265s __________ test_generic[executing] [assert 5 <= snapshot({0: 4})[0]] ___________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_12.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 <= snapshot({0: 4})[0] 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_12.py", line 9, in 265s assert 5 <= snapshot({0: 4})[0] 265s ^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____________ test_generic[executing] [assert 5 <= snapshot(3+2)] ______________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_13.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 <= snapshot(3+2) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _________ test_generic[executing] [assert 5 <= snapshot({0: 3+2})[0]] __________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_14.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 <= snapshot({0: 3+2})[0] 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic[executing] [assert 5 >= snapshot()] _______________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 265s new_code = self._value._new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 265s return self._file._value_to_code(self._new_value) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_15.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 >= snapshot() 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________ test_generic[executing] [assert 5 >= snapshot({})[0]] _____________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 265s to_insert.append((key, new_value_element._new_code())) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 265s return self._file._value_to_code(self._new_value) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_16.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 >= snapshot({})[0] 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic[executing] [assert 5 >= snapshot(4)] _______________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_17.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 >= snapshot(4) 265s ------------------------------ Captured log call ------------------------------- 265s 265s __________ test_generic[executing] [assert 5 >= snapshot({0: 4})[0]] ___________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_18.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 >= snapshot({0: 4})[0] 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic[executing] [assert 4 >= snapshot(5)] _______________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_19.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 4 >= snapshot(5) 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_19.py", line 9, in 265s assert 4 >= snapshot(5) 265s ^^^^^^^^^^^^^^^^ 265s AssertionError 265s ------------------------------ Captured log call ------------------------------- 265s 265s __________ test_generic[executing] [assert 4 >= snapshot({0: 5})[0]] ___________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_20.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 4 >= snapshot({0: 5})[0] 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_20.py", line 9, in 265s assert 4 >= snapshot({0: 5})[0] 265s ^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____________ test_generic[executing] [assert 5 >= snapshot(3+2)] ______________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_21.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 >= snapshot(3+2) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _________ test_generic[executing] [assert 5 >= snapshot({0: 3+2})[0]] __________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_22.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 >= snapshot({0: 3+2})[0] 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic[executing] [assert 5 in snapshot()] _______________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 265s new_code = self._value._new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:411: in _new_code 265s return self._file._value_to_code(self._new_value) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '[5 ]' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_23.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 in snapshot() 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________ test_generic[executing] [assert 5 in snapshot({})[0]] _____________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 265s to_insert.append((key, new_value_element._new_code())) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:411: in _new_code 265s return self._file._value_to_code(self._new_value) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '[5 ]' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_24.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 in snapshot({})[0] 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________ test_generic[executing] [assert 5 in snapshot([4, 5])] ____________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s s = source(code) 265s print("source:", code) 265s 265s if not executing_used and reported_flag == "update": 265s assert not s.flags 265s else: 265s assert list(s.flags) == [reported_flag] 265s 265s assert (reported_flag == "fix") == s.error 265s 265s for flag in all_flags: 265s if flag == reported_flag: 265s continue 265s print("use flag:", flag) 265s s2 = s.run(flag) 265s assert s2.source == s.source 265s 265s if not executing_used: 265s continue 265s 265s > s2 = s.run(reported_flag) 265s 265s tests/test_inline_snapshot.py:99: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:137: in run 265s recorder.fix_all() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 265s file.rewrite() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 265s new_code = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s 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])' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_29.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 in snapshot([4, 5]) 265s reported_flags: {'trim'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert 5 in snapshot([4, 5]) 265s source: assert 5 in snapshot([4, 5]) 265s use flag: fix 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 in snapshot([4, 5]) 265s reported_flags: {'trim'} 265s run: pytest --inline-snapshot=fix 265s output: 265s |assert 5 in snapshot([4, 5]) 265s use flag: create 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 in snapshot([4, 5]) 265s reported_flags: {'trim'} 265s run: pytest --inline-snapshot=create 265s output: 265s |assert 5 in snapshot([4, 5]) 265s use flag: update 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 in snapshot([4, 5]) 265s reported_flags: {'trim'} 265s run: pytest --inline-snapshot=update 265s output: 265s |assert 5 in snapshot([4, 5]) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 in snapshot([4, 5]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ________ test_generic[executing] [assert 5 in snapshot({0: [4, 5]})[0]] ________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s s = source(code) 265s print("source:", code) 265s 265s if not executing_used and reported_flag == "update": 265s assert not s.flags 265s else: 265s assert list(s.flags) == [reported_flag] 265s 265s assert (reported_flag == "fix") == s.error 265s 265s for flag in all_flags: 265s if flag == reported_flag: 265s continue 265s print("use flag:", flag) 265s s2 = s.run(flag) 265s assert s2.source == s.source 265s 265s if not executing_used: 265s continue 265s 265s > s2 = s.run(reported_flag) 265s 265s tests/test_inline_snapshot.py:99: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:137: in run 265s recorder.fix_all() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 265s file.rewrite() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 265s new_code = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s 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]' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_34.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 in snapshot({0: [4, 5]})[0] 265s reported_flags: {'trim'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert 5 in snapshot({0: [4, 5]})[0] 265s source: assert 5 in snapshot({0: [4, 5]})[0] 265s use flag: fix 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 in snapshot({0: [4, 5]})[0] 265s reported_flags: {'trim'} 265s run: pytest --inline-snapshot=fix 265s output: 265s |assert 5 in snapshot({0: [4, 5]})[0] 265s use flag: create 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 in snapshot({0: [4, 5]})[0] 265s reported_flags: {'trim'} 265s run: pytest --inline-snapshot=create 265s output: 265s |assert 5 in snapshot({0: [4, 5]})[0] 265s use flag: update 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 in snapshot({0: [4, 5]})[0] 265s reported_flags: {'trim'} 265s run: pytest --inline-snapshot=update 265s output: 265s |assert 5 in snapshot({0: [4, 5]})[0] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 in snapshot({0: [4, 5]})[0] 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic[executing] [assert 5 in snapshot([])] ______________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 265s new_code=[self._file._value_to_code(v) for v in new_values], 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_35.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 in snapshot([]) 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_35.py", line 9, in 265s assert 5 in snapshot([]) 265s ^^^^^^^^^^^^^^^^^ 265s AssertionError 265s ------------------------------ Captured log call ------------------------------- 265s 265s __________ test_generic[executing] [assert 5 in snapshot({0: []})[0]] __________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 265s new_code=[self._file._value_to_code(v) for v in new_values], 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_36.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 in snapshot({0: []})[0] 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_36.py", line 9, in 265s assert 5 in snapshot({0: []})[0] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________ test_generic[executing] [assert 5 in snapshot([3+2])] _____________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_37.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 in snapshot([3+2]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ________ test_generic[executing] [assert 5 in snapshot({0: [3+2]})[0]] _________ 265s 265s source = .w at 0x611fc2637ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s executing_used = True 265s 265s def test_generic(source, subtests, executing_used): 265s codes = [] 265s 265s for op in operations: 265s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 265s if op.svalue: 265s codes.append( 265s ( 265s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 265s op.flag, 265s ) 265s ) 265s else: 265s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 265s 265s all_flags = ["trim", "fix", "create", "update"] 265s 265s for code, reported_flag in codes: 265s with subtests.test(code): 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:79: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_38.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 in snapshot({0: [3+2]})[0] 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic_multi[executing-create(==) fix(==)] _______________ 265s 265s source = .w at 0x611fc2422ac0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='==', svalue='5', fvalue='4', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c0/test_1.py:10: in 265s print(4 == s["k_0"]) # create -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": 5}) 265s |print(4 == s["k_0"]) # create -> 4 265s |print(4 == s["k_1"]) # fix 5 -> 4 265s _____________ test_generic_multi[executing-create(==) update(==)] ______________ 265s 265s source = .w at 0x611fc2423240> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c1/test_1.py:10: in 265s print(4 == s["k_0"]) # create -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c1/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": 2+2}) 265s |print(4 == s["k_0"]) # create -> 4 265s |print(4 == s["k_1"]) # update 2+2 -> 4 265s _____________ test_generic_multi[executing-create(==) create(<=)] ______________ 265s 265s source = .w at 0x611fc2422a20> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='<=', svalue='', fvalue='4', flag='create')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c2/test_1.py:10: in 265s print(4 == s["k_0"]) # create -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c2/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({}) 265s |print(4 == s["k_0"]) # create -> 4 265s |print(4 <= s["k_1"]) # create -> 4 265s ______________ test_generic_multi[executing-create(==) trim(<=)] _______________ 265s 265s source = .w at 0x611fc2423e20> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c3/test_1.py:10: in 265s print(4 == s["k_0"]) # create -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c3/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": 5}) 265s |print(4 == s["k_0"]) # create -> 4 265s |print(4 <= s["k_1"]) # trim 5 -> 4 265s _______________ test_generic_multi[executing-create(==) fix(<=)] _______________ 265s 265s source = .w at 0x611fc1fd0860> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c4/test_1.py:10: in 265s print(4 == s["k_0"]) # create -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c4/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": 4}) 265s |print(4 == s["k_0"]) # create -> 4 265s |print(5 <= s["k_1"]) # fix 4 -> 5 265s _____________ test_generic_multi[executing-create(==) update(<=)] ______________ 265s 265s source = .w at 0x611fc2423e20> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c5/test_1.py:10: in 265s print(4 == s["k_0"]) # create -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c5/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": 3+2}) 265s |print(4 == s["k_0"]) # create -> 4 265s |print(5 <= s["k_1"]) # update 3+2 -> 5 265s _____________ test_generic_multi[executing-create(==) create(>=)] ______________ 265s 265s source = .w at 0x611fc1fd0540> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c6/test_1.py:10: in 265s print(4 == s["k_0"]) # create -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c6/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({}) 265s |print(4 == s["k_0"]) # create -> 4 265s |print(5 >= s["k_1"]) # create -> 5 265s ______________ test_generic_multi[executing-create(==) trim(>=)] _______________ 265s 265s source = .w at 0x611fc1fd1940> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c7/test_1.py:10: in 265s print(4 == s["k_0"]) # create -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c7/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": 4}) 265s |print(4 == s["k_0"]) # create -> 4 265s |print(5 >= s["k_1"]) # trim 4 -> 5 265s _______________ test_generic_multi[executing-create(==) fix(>=)] _______________ 265s 265s source = .w at 0x611fc2422b60> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c8/test_1.py:10: in 265s print(4 == s["k_0"]) # create -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c8/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": 5}) 265s |print(4 == s["k_0"]) # create -> 4 265s |print(4 >= s["k_1"]) # fix 5 -> 4 265s _____________ test_generic_multi[executing-create(==) update(>=)] ______________ 265s 265s source = .w at 0x611fc1fd1080> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c9/test_1.py:10: in 265s print(4 == s["k_0"]) # create -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c9/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": 3+2}) 265s |print(4 == s["k_0"]) # create -> 4 265s |print(5 >= s["k_1"]) # update 3+2 -> 5 265s _____________ test_generic_multi[executing-create(==) create(in)] ______________ 265s 265s source = .w at 0x611fc1fd2980> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c10/test_1.py:10: in 265s print(4 == s["k_0"]) # create -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c10/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({}) 265s |print(4 == s["k_0"]) # create -> 4 265s |print(5 in s["k_1"]) # create -> [5] 265s ______________ test_generic_multi[executing-create(==) trim(in)] _______________ 265s 265s source = .w at 0x611fc2637b00> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c11/test_1.py:10: in 265s print(4 == s["k_0"]) # create -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c11/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": [4, 5]}) 265s |print(4 == s["k_0"]) # create -> 4 265s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 265s _______________ test_generic_multi[executing-create(==) fix(in)] _______________ 265s 265s source = .w at 0x611fc24237e0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c12/test_1.py:10: in 265s print(4 == s["k_0"]) # create -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c12/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": []}) 265s |print(4 == s["k_0"]) # create -> 4 265s |print(5 in s["k_1"]) # fix [] -> [5] 265s _____________ test_generic_multi[executing-create(==) update(in)] ______________ 265s 265s source = .w at 0x611fc24207c0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c13/test_1.py:10: in 265s print(4 == s["k_0"]) # create -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c13/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": [3+2]}) 265s |print(4 == s["k_0"]) # create -> 4 265s |print(5 in s["k_1"]) # update [3+2] -> [5] 265s _______________ test_generic_multi[executing-fix(==) update(==)] _______________ 265s 265s source = .w at 0x611fc26360c0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f0/test_1.py:10: in 265s print(4 == s["k_0"]) # fix 5 -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5, "k_1": 2+2}) 265s |print(4 == s["k_0"]) # fix 5 -> 4 265s |print(4 == s["k_1"]) # update 2+2 -> 4 265s _______________ test_generic_multi[executing-fix(==) create(<=)] _______________ 265s 265s source = .w at 0x611fc24234c0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='4', op='<=', svalue='', fvalue='4', flag='create')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f1/test_1.py:10: in 265s print(4 == s["k_0"]) # fix 5 -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f1/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5}) 265s |print(4 == s["k_0"]) # fix 5 -> 4 265s |print(4 <= s["k_1"]) # create -> 4 265s ________________ test_generic_multi[executing-fix(==) trim(<=)] ________________ 265s 265s source = .w at 0x611fc1fd0680> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f2/test_1.py:10: in 265s print(4 == s["k_0"]) # fix 5 -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f2/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5, "k_1": 5}) 265s |print(4 == s["k_0"]) # fix 5 -> 4 265s |print(4 <= s["k_1"]) # trim 5 -> 4 265s ________________ test_generic_multi[executing-fix(==) fix(<=)] _________________ 265s 265s source = .w at 0x611fc24232e0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f3/test_1.py:10: in 265s print(4 == s["k_0"]) # fix 5 -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f3/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5, "k_1": 4}) 265s |print(4 == s["k_0"]) # fix 5 -> 4 265s |print(5 <= s["k_1"]) # fix 4 -> 5 265s _______________ test_generic_multi[executing-fix(==) update(<=)] _______________ 265s 265s source = .w at 0x611fc1fd2020> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f4/test_1.py:10: in 265s print(4 == s["k_0"]) # fix 5 -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f4/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5, "k_1": 3+2}) 265s |print(4 == s["k_0"]) # fix 5 -> 4 265s |print(5 <= s["k_1"]) # update 3+2 -> 5 265s _______________ test_generic_multi[executing-fix(==) create(>=)] _______________ 265s 265s source = .w at 0x611fc1fd3560> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f5/test_1.py:10: in 265s print(4 == s["k_0"]) # fix 5 -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f5/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5}) 265s |print(4 == s["k_0"]) # fix 5 -> 4 265s |print(5 >= s["k_1"]) # create -> 5 265s ________________ test_generic_multi[executing-fix(==) trim(>=)] ________________ 265s 265s source = .w at 0x611fc24239c0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f6/test_1.py:10: in 265s print(4 == s["k_0"]) # fix 5 -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f6/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5, "k_1": 4}) 265s |print(4 == s["k_0"]) # fix 5 -> 4 265s |print(5 >= s["k_1"]) # trim 4 -> 5 265s ________________ test_generic_multi[executing-fix(==) fix(>=)] _________________ 265s 265s source = .w at 0x611fc1fd1940> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f7/test_1.py:10: in 265s print(4 == s["k_0"]) # fix 5 -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f7/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5, "k_1": 5}) 265s |print(4 == s["k_0"]) # fix 5 -> 4 265s |print(4 >= s["k_1"]) # fix 5 -> 4 265s _______________ test_generic_multi[executing-fix(==) update(>=)] _______________ 265s 265s source = .w at 0x611fc20e85e0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f8/test_1.py:10: in 265s print(4 == s["k_0"]) # fix 5 -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f8/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5, "k_1": 3+2}) 265s |print(4 == s["k_0"]) # fix 5 -> 4 265s |print(5 >= s["k_1"]) # update 3+2 -> 5 265s _______________ test_generic_multi[executing-fix(==) create(in)] _______________ 265s 265s source = .w at 0x611fc2423420> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f9/test_1.py:10: in 265s print(4 == s["k_0"]) # fix 5 -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f9/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5}) 265s |print(4 == s["k_0"]) # fix 5 -> 4 265s |print(5 in s["k_1"]) # create -> [5] 265s ________________ test_generic_multi[executing-fix(==) trim(in)] ________________ 265s 265s source = .w at 0x611fc20e8ea0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f10/test_1.py:10: in 265s print(4 == s["k_0"]) # fix 5 -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f10/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5, "k_1": [4, 5]}) 265s |print(4 == s["k_0"]) # fix 5 -> 4 265s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 265s ________________ test_generic_multi[executing-fix(==) fix(in)] _________________ 265s 265s source = .w at 0x611fc20e96c0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f11/test_1.py:10: in 265s print(4 == s["k_0"]) # fix 5 -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f11/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5, "k_1": []}) 265s |print(4 == s["k_0"]) # fix 5 -> 4 265s |print(5 in s["k_1"]) # fix [] -> [5] 265s _______________ test_generic_multi[executing-fix(==) update(in)] _______________ 265s 265s source = .w at 0x611fc2423420> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f12/test_1.py:10: in 265s print(4 == s["k_0"]) # fix 5 -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f12/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5, "k_1": [3+2]}) 265s |print(4 == s["k_0"]) # fix 5 -> 4 265s |print(5 in s["k_1"]) # update [3+2] -> [5] 265s _____________ test_generic_multi[executing-update(==) create(<=)] ______________ 265s 265s source = .w at 0x611fc20e93a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='4', op='<=', svalue='', fvalue='4', flag='create')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u0/test_1.py:10: in 265s print(4 == s["k_0"]) # update 2+2 -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 2+2}) 265s |print(4 == s["k_0"]) # update 2+2 -> 4 265s |print(4 <= s["k_1"]) # create -> 4 265s ______________ test_generic_multi[executing-update(==) trim(<=)] _______________ 265s 265s source = .w at 0x611fc20ea7a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u1/test_1.py:10: in 265s print(4 == s["k_0"]) # update 2+2 -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u1/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 2+2, "k_1": 5}) 265s |print(4 == s["k_0"]) # update 2+2 -> 4 265s |print(4 <= s["k_1"]) # trim 5 -> 4 265s _______________ test_generic_multi[executing-update(==) fix(<=)] _______________ 265s 265s source = .w at 0x611fc1fd22a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u2/test_1.py:10: in 265s print(4 == s["k_0"]) # update 2+2 -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u2/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 2+2, "k_1": 4}) 265s |print(4 == s["k_0"]) # update 2+2 -> 4 265s |print(5 <= s["k_1"]) # fix 4 -> 5 265s _____________ test_generic_multi[executing-update(==) update(<=)] ______________ 265s 265s source = .w at 0x611fc20e93a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u3/test_1.py:10: in 265s print(4 == s["k_0"]) # update 2+2 -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u3/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 2+2, "k_1": 3+2}) 265s |print(4 == s["k_0"]) # update 2+2 -> 4 265s |print(5 <= s["k_1"]) # update 3+2 -> 5 265s _____________ test_generic_multi[executing-update(==) create(>=)] ______________ 265s 265s source = .w at 0x611fc20eb880> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u4/test_1.py:10: in 265s print(4 == s["k_0"]) # update 2+2 -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u4/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 2+2}) 265s |print(4 == s["k_0"]) # update 2+2 -> 4 265s |print(5 >= s["k_1"]) # create -> 5 265s ______________ test_generic_multi[executing-update(==) trim(>=)] _______________ 265s 265s source = .w at 0x611fc1fd3d80> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u5/test_1.py:10: in 265s print(4 == s["k_0"]) # update 2+2 -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u5/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 2+2, "k_1": 4}) 265s |print(4 == s["k_0"]) # update 2+2 -> 4 265s |print(5 >= s["k_1"]) # trim 4 -> 5 265s _______________ test_generic_multi[executing-update(==) fix(>=)] _______________ 265s 265s source = .w at 0x611fc20eb100> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u6/test_1.py:10: in 265s print(4 == s["k_0"]) # update 2+2 -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u6/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 2+2, "k_1": 5}) 265s |print(4 == s["k_0"]) # update 2+2 -> 4 265s |print(4 >= s["k_1"]) # fix 5 -> 4 265s _____________ test_generic_multi[executing-update(==) update(>=)] ______________ 265s 265s source = .w at 0x611fc1ebc9a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u7/test_1.py:10: in 265s print(4 == s["k_0"]) # update 2+2 -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u7/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 2+2, "k_1": 3+2}) 265s |print(4 == s["k_0"]) # update 2+2 -> 4 265s |print(5 >= s["k_1"]) # update 3+2 -> 5 265s _____________ test_generic_multi[executing-update(==) create(in)] ______________ 265s 265s source = .w at 0x611fc20e8fe0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u8/test_1.py:10: in 265s print(4 == s["k_0"]) # update 2+2 -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u8/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 2+2}) 265s |print(4 == s["k_0"]) # update 2+2 -> 4 265s |print(5 in s["k_1"]) # create -> [5] 265s ______________ test_generic_multi[executing-update(==) trim(in)] _______________ 265s 265s source = .w at 0x611fc1ebc0e0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u9/test_1.py:10: in 265s print(4 == s["k_0"]) # update 2+2 -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u9/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 2+2, "k_1": [4, 5]}) 265s |print(4 == s["k_0"]) # update 2+2 -> 4 265s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 265s _______________ test_generic_multi[executing-update(==) fix(in)] _______________ 265s 265s source = .w at 0x611fc1ebd940> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u10/test_1.py:10: in 265s print(4 == s["k_0"]) # update 2+2 -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u10/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 2+2, "k_1": []}) 265s |print(4 == s["k_0"]) # update 2+2 -> 4 265s |print(5 in s["k_1"]) # fix [] -> [5] 265s _____________ test_generic_multi[executing-update(==) update(in)] ______________ 265s 265s source = .w at 0x611fc20e8f40> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u11/test_1.py:10: in 265s print(4 == s["k_0"]) # update 2+2 -> 4 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u11/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 2+2, "k_1": [3+2]}) 265s |print(4 == s["k_0"]) # update 2+2 -> 4 265s |print(5 in s["k_1"]) # update [3+2] -> [5] 265s ______________ test_generic_multi[executing-create(<=) trim(<=)] _______________ 265s 265s source = .w at 0x611fc1ebd080> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c14/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": 5}) 265s |print(4 <= s["k_0"]) # create -> 4 265s |print(4 <= s["k_1"]) # trim 5 -> 4 265s True 265s True 265s _______________ test_generic_multi[executing-create(<=) fix(<=)] _______________ 265s 265s source = .w at 0x611fc1ebe5c0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c15/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": 4}) 265s |print(4 <= s["k_0"]) # create -> 4 265s |print(5 <= s["k_1"]) # fix 4 -> 5 265s True 265s False 265s _____________ test_generic_multi[executing-create(<=) update(<=)] ______________ 265s 265s source = .w at 0x611fc20ea020> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c16/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": 3+2}) 265s |print(4 <= s["k_0"]) # create -> 4 265s |print(5 <= s["k_1"]) # update 3+2 -> 5 265s True 265s True 265s _____________ test_generic_multi[executing-create(<=) create(>=)] ______________ 265s 265s source = .w at 0x611fc1ebc4a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 265s to_insert.append((key, new_value_element._new_code())) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 265s return self._file._value_to_code(self._new_value) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c17/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({}) 265s |print(4 <= s["k_0"]) # create -> 4 265s |print(5 >= s["k_1"]) # create -> 5 265s True 265s True 265s ______________ test_generic_multi[executing-create(<=) trim(>=)] _______________ 265s 265s source = .w at 0x611fc1ebf560> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c18/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": 4}) 265s |print(4 <= s["k_0"]) # create -> 4 265s |print(5 >= s["k_1"]) # trim 4 -> 5 265s True 265s True 265s _______________ test_generic_multi[executing-create(<=) fix(>=)] _______________ 265s 265s source = .w at 0x611fc2dd53a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c19/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": 5}) 265s |print(4 <= s["k_0"]) # create -> 4 265s |print(4 >= s["k_1"]) # fix 5 -> 4 265s True 265s False 265s _____________ test_generic_multi[executing-create(<=) update(>=)] ______________ 265s 265s source = .w at 0x611fc1fd37e0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c20/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": 3+2}) 265s |print(4 <= s["k_0"]) # create -> 4 265s |print(5 >= s["k_1"]) # update 3+2 -> 5 265s True 265s True 265s _____________ test_generic_multi[executing-create(<=) create(in)] ______________ 265s 265s source = .w at 0x611fc1fd1620> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 265s to_insert.append((key, new_value_element._new_code())) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 265s return self._file._value_to_code(self._new_value) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c21/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({}) 265s |print(4 <= s["k_0"]) # create -> 4 265s |print(5 in s["k_1"]) # create -> [5] 265s True 265s True 265s ______________ test_generic_multi[executing-create(<=) trim(in)] _______________ 265s 265s source = .w at 0x611fc2420360> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 265s to_insert.append((key, new_value_element._new_code())) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 265s return self._file._value_to_code(self._new_value) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c22/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": [4, 5]}) 265s |print(4 <= s["k_0"]) # create -> 4 265s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 265s True 265s True 265s _______________ test_generic_multi[executing-create(<=) fix(in)] _______________ 265s 265s source = .w at 0x611fc1fd3600> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 265s new_code=[self._file._value_to_code(v) for v in new_values], 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c23/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": []}) 265s |print(4 <= s["k_0"]) # create -> 4 265s |print(5 in s["k_1"]) # fix [] -> [5] 265s True 265s False 265s _____________ test_generic_multi[executing-create(<=) update(in)] ______________ 265s 265s source = .w at 0x611fc20eb7e0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c24/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": [3+2]}) 265s |print(4 <= s["k_0"]) # create -> 4 265s |print(5 in s["k_1"]) # update [3+2] -> [5] 265s True 265s True 265s ________________ test_generic_multi[executing-trim(<=) fix(<=)] ________________ 265s 265s source = .w at 0x611fc2422ca0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5, "k_1": 4}) 265s |print(4 <= s["k_0"]) # trim 5 -> 4 265s |print(5 <= s["k_1"]) # fix 4 -> 5 265s True 265s False 265s ______________ test_generic_multi[executing-trim(<=) update(<=)] _______________ 265s 265s source = .w at 0x611fc20e98a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t1/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5, "k_1": 3+2}) 265s |print(4 <= s["k_0"]) # trim 5 -> 4 265s |print(5 <= s["k_1"]) # update 3+2 -> 5 265s True 265s True 265s ______________ test_generic_multi[executing-trim(<=) create(>=)] _______________ 265s 265s source = .w at 0x611fc20e9b20> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t2/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5}) 265s |print(4 <= s["k_0"]) # trim 5 -> 4 265s |print(5 >= s["k_1"]) # create -> 5 265s True 265s True 265s _______________ test_generic_multi[executing-trim(<=) trim(>=)] ________________ 265s 265s source = .w at 0x611fc2420b80> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t3/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5, "k_1": 4}) 265s |print(4 <= s["k_0"]) # trim 5 -> 4 265s |print(5 >= s["k_1"]) # trim 4 -> 5 265s True 265s True 265s ________________ test_generic_multi[executing-trim(<=) fix(>=)] ________________ 265s 265s source = .w at 0x611fc20e9620> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t4/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5, "k_1": 5}) 265s |print(4 <= s["k_0"]) # trim 5 -> 4 265s |print(4 >= s["k_1"]) # fix 5 -> 4 265s True 265s False 265s ______________ test_generic_multi[executing-trim(<=) update(>=)] _______________ 265s 265s source = .w at 0x611fc1ebef20> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t5/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5, "k_1": 3+2}) 265s |print(4 <= s["k_0"]) # trim 5 -> 4 265s |print(5 >= s["k_1"]) # update 3+2 -> 5 265s True 265s True 265s ______________ test_generic_multi[executing-trim(<=) create(in)] _______________ 265s 265s source = .w at 0x611fc20ebb00> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t6/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5}) 265s |print(4 <= s["k_0"]) # trim 5 -> 4 265s |print(5 in s["k_1"]) # create -> [5] 265s True 265s True 265s _______________ test_generic_multi[executing-trim(<=) trim(in)] ________________ 265s 265s source = .w at 0x611fc1ebccc0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t7/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5, "k_1": [4, 5]}) 265s |print(4 <= s["k_0"]) # trim 5 -> 4 265s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 265s True 265s True 265s ________________ test_generic_multi[executing-trim(<=) fix(in)] ________________ 265s 265s source = .w at 0x611fc1ebc4a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t8/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5, "k_1": []}) 265s |print(4 <= s["k_0"]) # trim 5 -> 4 265s |print(5 in s["k_1"]) # fix [] -> [5] 265s True 265s False 265s ______________ test_generic_multi[executing-trim(<=) update(in)] _______________ 265s 265s source = .w at 0x611fc20eb1a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t9/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5, "k_1": [3+2]}) 265s |print(4 <= s["k_0"]) # trim 5 -> 4 265s |print(5 in s["k_1"]) # update [3+2] -> [5] 265s True 265s True 265s _______________ test_generic_multi[executing-fix(<=) update(<=)] _______________ 265s 265s source = .w at 0x611fc1ebcf40> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f13/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 4, "k_1": 3+2}) 265s |print(5 <= s["k_0"]) # fix 4 -> 5 265s |print(5 <= s["k_1"]) # update 3+2 -> 5 265s False 265s True 265s _______________ test_generic_multi[executing-fix(<=) create(>=)] _______________ 265s 265s source = .w at 0x611fc29d05e0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f14/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 4}) 265s |print(5 <= s["k_0"]) # fix 4 -> 5 265s |print(5 >= s["k_1"]) # create -> 5 265s False 265s True 265s ________________ test_generic_multi[executing-fix(<=) trim(>=)] ________________ 265s 265s source = .w at 0x611fc20eac00> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f15/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 4, "k_1": 4}) 265s |print(5 <= s["k_0"]) # fix 4 -> 5 265s |print(5 >= s["k_1"]) # trim 4 -> 5 265s False 265s True 265s ________________ test_generic_multi[executing-fix(<=) fix(>=)] _________________ 265s 265s source = .w at 0x611fc29d1080> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f16/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 4, "k_1": 5}) 265s |print(5 <= s["k_0"]) # fix 4 -> 5 265s |print(4 >= s["k_1"]) # fix 5 -> 4 265s False 265s False 265s _______________ test_generic_multi[executing-fix(<=) update(>=)] _______________ 265s 265s source = .w at 0x611fc29d14e0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f17/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 4, "k_1": 3+2}) 265s |print(5 <= s["k_0"]) # fix 4 -> 5 265s |print(5 >= s["k_1"]) # update 3+2 -> 5 265s False 265s True 265s _______________ test_generic_multi[executing-fix(<=) create(in)] _______________ 265s 265s source = .w at 0x611fc1fd2fc0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f18/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 4}) 265s |print(5 <= s["k_0"]) # fix 4 -> 5 265s |print(5 in s["k_1"]) # create -> [5] 265s False 265s True 265s ________________ test_generic_multi[executing-fix(<=) trim(in)] ________________ 265s 265s source = .w at 0x611fc29d11c0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f19/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 4, "k_1": [4, 5]}) 265s |print(5 <= s["k_0"]) # fix 4 -> 5 265s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 265s False 265s True 265s ________________ test_generic_multi[executing-fix(<=) fix(in)] _________________ 265s 265s source = .w at 0x611fc29d2660> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f20/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 4, "k_1": []}) 265s |print(5 <= s["k_0"]) # fix 4 -> 5 265s |print(5 in s["k_1"]) # fix [] -> [5] 265s False 265s False 265s _______________ test_generic_multi[executing-fix(<=) update(in)] _______________ 265s 265s source = .w at 0x611fc1ebcf40> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f21/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 4, "k_1": [3+2]}) 265s |print(5 <= s["k_0"]) # fix 4 -> 5 265s |print(5 in s["k_1"]) # update [3+2] -> [5] 265s False 265s True 265s _____________ test_generic_multi[executing-update(<=) create(>=)] ______________ 265s 265s source = .w at 0x611fc29d1f80> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u12/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 3+2}) 265s |print(5 <= s["k_0"]) # update 3+2 -> 5 265s |print(5 >= s["k_1"]) # create -> 5 265s True 265s True 265s ______________ test_generic_multi[executing-update(<=) trim(>=)] _______________ 265s 265s source = .w at 0x611fc29d3740> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u13/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 3+2, "k_1": 4}) 265s |print(5 <= s["k_0"]) # update 3+2 -> 5 265s |print(5 >= s["k_1"]) # trim 4 -> 5 265s True 265s True 265s _______________ test_generic_multi[executing-update(<=) fix(>=)] _______________ 265s 265s source = .w at 0x611fc1ebe840> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u14/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 3+2, "k_1": 5}) 265s |print(5 <= s["k_0"]) # update 3+2 -> 5 265s |print(4 >= s["k_1"]) # fix 5 -> 4 265s True 265s False 265s _____________ test_generic_multi[executing-update(<=) update(>=)] ______________ 265s 265s source = .w at 0x611fc29d0540> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==)]>>) 265s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u15/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 3+2, "k_1": 3+2}) 265s |print(5 <= s["k_0"]) # update 3+2 -> 5 265s |print(5 >= s["k_1"]) # update 3+2 -> 5 265s True 265s True 265s _____________ test_generic_multi[executing-update(<=) create(in)] ______________ 265s 265s source = .w at 0x611fc1da0860> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u16/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 3+2}) 265s |print(5 <= s["k_0"]) # update 3+2 -> 5 265s |print(5 in s["k_1"]) # create -> [5] 265s True 265s True 265s ______________ test_generic_multi[executing-update(<=) trim(in)] _______________ 265s 265s source = .w at 0x611fc29d0540> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u17/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 3+2, "k_1": [4, 5]}) 265s |print(5 <= s["k_0"]) # update 3+2 -> 5 265s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 265s True 265s True 265s _______________ test_generic_multi[executing-update(<=) fix(in)] _______________ 265s 265s source = .w at 0x611fc1da13a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u18/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 3+2, "k_1": []}) 265s |print(5 <= s["k_0"]) # update 3+2 -> 5 265s |print(5 in s["k_1"]) # fix [] -> [5] 265s True 265s False 265s _____________ test_generic_multi[executing-update(<=) update(in)] ______________ 265s 265s source = .w at 0x611fc1da18a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u19/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 3+2, "k_1": [3+2]}) 265s |print(5 <= s["k_0"]) # update 3+2 -> 5 265s |print(5 in s["k_1"]) # update [3+2] -> [5] 265s True 265s True 265s ______________ test_generic_multi[executing-create(>=) trim(>=)] _______________ 265s 265s source = .w at 0x611fc29d0040> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==) trim(>=)]>>) 265s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c25/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": 4}) 265s |print(5 >= s["k_0"]) # create -> 5 265s |print(5 >= s["k_1"]) # trim 4 -> 5 265s True 265s True 265s _______________ test_generic_multi[executing-create(>=) fix(>=)] _______________ 265s 265s source = .w at 0x611fc29d3f60> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==) fix(>=)]>>) 265s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c26/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": 5}) 265s |print(5 >= s["k_0"]) # create -> 5 265s |print(4 >= s["k_1"]) # fix 5 -> 4 265s True 265s False 265s _____________ test_generic_multi[executing-create(>=) update(>=)] ______________ 265s 265s source = .w at 0x611fc29d2ac0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==) update(>=)]>>) 265s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c27/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": 3+2}) 265s |print(5 >= s["k_0"]) # create -> 5 265s |print(5 >= s["k_1"]) # update 3+2 -> 5 265s True 265s True 265s _____________ test_generic_multi[executing-create(>=) create(in)] ______________ 265s 265s source = .w at 0x611fc29d0720> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==) create(in)]>>) 265s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 265s to_insert.append((key, new_value_element._new_code())) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 265s return self._file._value_to_code(self._new_value) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c28/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({}) 265s |print(5 >= s["k_0"]) # create -> 5 265s |print(5 in s["k_1"]) # create -> [5] 265s True 265s True 265s ______________ test_generic_multi[executing-create(>=) trim(in)] _______________ 265s 265s source = .w at 0x611fc29d28e0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==) trim(in)]>>) 265s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 265s to_insert.append((key, new_value_element._new_code())) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 265s return self._file._value_to_code(self._new_value) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c29/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": [4, 5]}) 265s |print(5 >= s["k_0"]) # create -> 5 265s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 265s True 265s True 265s _______________ test_generic_multi[executing-create(>=) fix(in)] _______________ 265s 265s source = .w at 0x611fc29d3ce0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==) fix(in)]>>) 265s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 265s new_code=[self._file._value_to_code(v) for v in new_values], 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c30/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": []}) 265s |print(5 >= s["k_0"]) # create -> 5 265s |print(5 in s["k_1"]) # fix [] -> [5] 265s True 265s False 265s _____________ test_generic_multi[executing-create(>=) update(in)] ______________ 265s 265s source = .w at 0x611fc20eaac0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==) update(in)]>>) 265s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c31/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": [3+2]}) 265s |print(5 >= s["k_0"]) # create -> 5 265s |print(5 in s["k_1"]) # update [3+2] -> [5] 265s True 265s True 265s ________________ test_generic_multi[executing-trim(>=) fix(>=)] ________________ 265s 265s source = .w at 0x611fc20e8860> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==) fix(>=)]>>) 265s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t10/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 4, "k_1": 5}) 265s |print(5 >= s["k_0"]) # trim 4 -> 5 265s |print(4 >= s["k_1"]) # fix 5 -> 4 265s True 265s False 265s ______________ test_generic_multi[executing-trim(>=) update(>=)] _______________ 265s 265s source = .w at 0x611fc29d3740> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==) update(>=)]>>) 265s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t11/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 4, "k_1": 3+2}) 265s |print(5 >= s["k_0"]) # trim 4 -> 5 265s |print(5 >= s["k_1"]) # update 3+2 -> 5 265s True 265s True 265s ______________ test_generic_multi[executing-trim(>=) create(in)] _______________ 265s 265s source = .w at 0x611fc1ebe520> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==) create(in)]>>) 265s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t12/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 4}) 265s |print(5 >= s["k_0"]) # trim 4 -> 5 265s |print(5 in s["k_1"]) # create -> [5] 265s True 265s True 265s _______________ test_generic_multi[executing-trim(>=) trim(in)] ________________ 265s 265s source = .w at 0x611fc29d2c00> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==) trim(in)]>>) 265s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t13/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 4, "k_1": [4, 5]}) 265s |print(5 >= s["k_0"]) # trim 4 -> 5 265s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 265s True 265s True 265s ________________ test_generic_multi[executing-trim(>=) fix(in)] ________________ 265s 265s source = .w at 0x611fc1ebd8a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==) fix(in)]>>) 265s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t14/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 4, "k_1": []}) 265s |print(5 >= s["k_0"]) # trim 4 -> 5 265s |print(5 in s["k_1"]) # fix [] -> [5] 265s True 265s False 265s ______________ test_generic_multi[executing-trim(>=) update(in)] _______________ 265s 265s source = .w at 0x611fc1da05e0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==) update(in)]>>) 265s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t15/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 4, "k_1": [3+2]}) 265s |print(5 >= s["k_0"]) # trim 4 -> 5 265s |print(5 in s["k_1"]) # update [3+2] -> [5] 265s True 265s True 265s _______________ test_generic_multi[executing-fix(>=) update(>=)] _______________ 265s 265s source = .w at 0x611fc1ebfe20> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==) update(>=)]>>) 265s ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f22/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5, "k_1": 3+2}) 265s |print(4 >= s["k_0"]) # fix 5 -> 4 265s |print(5 >= s["k_1"]) # update 3+2 -> 5 265s False 265s True 265s _______________ test_generic_multi[executing-fix(>=) create(in)] _______________ 265s 265s source = .w at 0x611fc29d2c00> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==) create(in)]>>) 265s ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f23/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5}) 265s |print(4 >= s["k_0"]) # fix 5 -> 4 265s |print(5 in s["k_1"]) # create -> [5] 265s False 265s True 265s ________________ test_generic_multi[executing-fix(>=) trim(in)] ________________ 265s 265s source = .w at 0x611fc1da0c20> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==) trim(in)]>>) 265s ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f24/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5, "k_1": [4, 5]}) 265s |print(4 >= s["k_0"]) # fix 5 -> 4 265s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 265s False 265s True 265s ________________ test_generic_multi[executing-fix(>=) fix(in)] _________________ 265s 265s source = .w at 0x611fc29d2b60> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==) fix(in)]>>) 265s ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f25/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5, "k_1": []}) 265s |print(4 >= s["k_0"]) # fix 5 -> 4 265s |print(5 in s["k_1"]) # fix [] -> [5] 265s False 265s False 265s _______________ test_generic_multi[executing-fix(>=) update(in)] _______________ 265s 265s source = .w at 0x611fc1da2660> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==) update(in)]>>) 265s ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f26/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 5, "k_1": [3+2]}) 265s |print(4 >= s["k_0"]) # fix 5 -> 4 265s |print(5 in s["k_1"]) # update [3+2] -> [5] 265s False 265s True 265s _____________ test_generic_multi[executing-update(>=) create(in)] ______________ 265s 265s source = .w at 0x611fc1da2c00> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==) create(in)]>>) 265s ops = (operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u20/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 3+2}) 265s |print(5 >= s["k_0"]) # update 3+2 -> 5 265s |print(5 in s["k_1"]) # create -> [5] 265s True 265s True 265s ______________ test_generic_multi[executing-update(>=) trim(in)] _______________ 265s 265s source = .w at 0x611fc2636e80> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==) trim(in)]>>) 265s ops = (operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u21/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 3+2, "k_1": [4, 5]}) 265s |print(5 >= s["k_0"]) # update 3+2 -> 5 265s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 265s True 265s True 265s _______________ test_generic_multi[executing-update(>=) fix(in)] _______________ 265s 265s source = .w at 0x611fc1da0860> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==) fix(in)]>>) 265s ops = (operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u22/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 3+2, "k_1": []}) 265s |print(5 >= s["k_0"]) # update 3+2 -> 5 265s |print(5 in s["k_1"]) # fix [] -> [5] 265s True 265s False 265s _____________ test_generic_multi[executing-update(>=) update(in)] ______________ 265s 265s source = .w at 0x611fc1da3c40> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request==) update(in)]>>) 265s ops = (operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u23/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": 3+2, "k_1": [3+2]}) 265s |print(5 >= s["k_0"]) # update 3+2 -> 5 265s |print(5 in s["k_1"]) # update [3+2] -> [5] 265s True 265s True 265s ______________ test_generic_multi[executing-create(in) trim(in)] _______________ 265s 265s source = .w at 0x611fc1da28e0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='5', op='in', svalue='', fvalue='[5]', flag='create'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 265s to_insert.append((key, new_value_element._new_code())) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:411: in _new_code 265s return self._file._value_to_code(self._new_value) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '[5 ]' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c32/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": [4, 5]}) 265s |print(5 in s["k_0"]) # create -> [5] 265s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 265s True 265s True 265s _______________ test_generic_multi[executing-create(in) fix(in)] _______________ 265s 265s source = .w at 0x611fc1ebf560> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='5', op='in', svalue='', fvalue='[5]', flag='create'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 265s new_code=[self._file._value_to_code(v) for v in new_values], 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c33/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": []}) 265s |print(5 in s["k_0"]) # create -> [5] 265s |print(5 in s["k_1"]) # fix [] -> [5] 265s True 265s False 265s _____________ test_generic_multi[executing-create(in) update(in)] ______________ 265s 265s source = .w at 0x611fc25fcc20> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='5', op='in', svalue='', fvalue='[5]', flag='create'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c34/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_1": [3+2]}) 265s |print(5 in s["k_0"]) # create -> [5] 265s |print(5 in s["k_1"]) # update [3+2] -> [5] 265s True 265s True 265s ________________ test_generic_multi[executing-trim(in) fix(in)] ________________ 265s 265s source = .w at 0x611fc1da28e0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 265s new_code=[self._file._value_to_code(v) for v in new_values], 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t16/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": [4, 5], "k_1": []}) 265s |print(5 in s["k_0"]) # trim [4, 5] -> [5] 265s |print(5 in s["k_1"]) # fix [] -> [5] 265s True 265s False 265s ______________ test_generic_multi[executing-trim(in) update(in)] _______________ 265s 265s source = .w at 0x611fc25fd800> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s 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')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t17/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": [4, 5], "k_1": [3+2]}) 265s |print(5 in s["k_0"]) # trim [4, 5] -> [5] 265s |print(5 in s["k_1"]) # update [3+2] -> [5] 265s True 265s True 265s _______________ test_generic_multi[executing-fix(in) update(in)] _______________ 265s 265s source = .w at 0x611fc25fdd00> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx=>, request=>) 265s ops = (operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 265s executing_used = True 265s 265s @pytest.mark.parametrize( 265s "ops", 265s [ 265s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 265s for ops in itertools.combinations(operations, 2) 265s ], 265s ) 265s def test_generic_multi(source, subtests, ops, executing_used): 265s 265s def gen_code(ops, fixed, old_keys): 265s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 265s new_keys = [] 265s 265s args = [] 265s print(keys) 265s for k in keys: 265s op = ops[k] 265s value = op.fvalue if op.flag in fixed else op.svalue 265s if value: 265s args.append(f'"k_{k}": {value}') 265s new_keys.append(k) 265s args = ", ".join(args) 265s 265s code = "s = snapshot({" + args + "})\n" 265s 265s for k, op in enumerate(ops): 265s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 265s 265s return code, new_keys 265s 265s all_flags = {op.flag for op in ops} 265s 265s keys = [] 265s code, keys = gen_code(ops, {}, keys) 265s > s = source(code) 265s 265s tests/test_inline_snapshot.py:141: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 265s yield from self._new_value[key]._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 265s new_code=[self._file._value_to_code(v) for v in new_values], 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f27/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s [0, 1] 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot({"k_0": [], "k_1": [3+2]}) 265s |print(5 in s["k_0"]) # fix [] -> [5] 265s |print(5 in s["k_1"]) # update [3+2] -> [5] 265s False 265s True 265s _____________________________ test_mutable_values ______________________________ 265s 265s check_update = .w at 0x611fc1bf84a0> 265s 265s def test_mutable_values(check_update): 265s assert ( 265s > check_update( 265s """ 265s l=[1,2] 265s assert l==snapshot() 265s l.append(3) 265s assert l==snapshot() 265s """, 265s flags="create", 265s number=2, 265s ) 265s == snapshot( 265s """\ 265s 265s l=[1,2] 265s assert l==snapshot([1, 2]) 265s l.append(3) 265s assert l==snapshot([1, 2, 3]) 265s """ 265s ) 265s ) 265s 265s tests/test_inline_snapshot.py:168: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_mutable_values0/test_1.py:11: in 265s assert l==snapshot() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_mutable_values0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s | 265s |l=[1,2] 265s |assert l==snapshot() 265s |l.append(3) 265s |assert l==snapshot() 265s _______________________________ test_comparison ________________________________ 265s 265s check_update = .w at 0x611fc25fdf80> 265s 265s def test_comparison(check_update): 265s > assert check_update("assert 5==snapshot()", flags="create") == snapshot( 265s "assert 5==snapshot(5)" 265s ) 265s 265s tests/test_inline_snapshot.py:257: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_comparison0/test_1.py:9: in 265s assert 5==snapshot() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_comparison0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5==snapshot() 265s ___________________________________ test_ge ____________________________________ 265s 265s check_update = .w at 0x611fc25fd300> 265s 265s def test_ge(check_update): 265s > assert check_update("assert 5<=snapshot()", flags="create") == snapshot( 265s "assert 5<=snapshot(5)" 265s ) 265s 265s tests/test_inline_snapshot.py:309: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 265s new_code = self._value._new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 265s return self._file._value_to_code(self._new_value) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_ge0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5<=snapshot() 265s ___________________________________ test_le ____________________________________ 265s 265s check_update = .w at 0x611fc25fcf40> 265s 265s def test_le(check_update): 265s > assert check_update("assert 5>=snapshot()", flags="create") == snapshot( 265s "assert 5>=snapshot(5)" 265s ) 265s 265s tests/test_inline_snapshot.py:381: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 265s new_code = self._value._new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 265s return self._file._value_to_code(self._new_value) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_le0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5>=snapshot() 265s ________________________________ test_contains _________________________________ 265s 265s check_update = .w at 0x611fc1ebd760> 265s 265s def test_contains(check_update): 265s > assert check_update("assert 5 in snapshot()", flags="create") == snapshot( 265s "assert 5 in snapshot([5])" 265s ) 265s 265s tests/test_inline_snapshot.py:449: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 265s new_code = self._value._new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:411: in _new_code 265s return self._file._value_to_code(self._new_value) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '[5 ]' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_contains0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 in snapshot() 265s _________________________________ test_getitem _________________________________ 265s 265s check_update = .w at 0x611fc1fd3100> 265s 265s def test_getitem(check_update): 265s > assert check_update('assert 5 == snapshot()["test"]', flags="create") == snapshot( 265s 'assert 5 == snapshot({"test": 5})["test"]' 265s ) 265s 265s tests/test_inline_snapshot.py:492: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_getitem0/test_1.py:9: in 265s assert 5 == snapshot()["test"] 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_getitem0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 5 == snapshot()["test"] 265s _________________________________ test_assert __________________________________ 265s 265s check_update = .w at 0x611fc2634540> 265s 265s def test_assert(check_update): 265s > assert check_update("assert 2 == snapshot(5)", reported_flags="fix") 265s 265s tests/test_inline_snapshot.py:574: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_assert0/test_1.py:9: in 265s assert 2 == snapshot(5) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '2 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_assert0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert 2 == snapshot(5) 265s _______________________________ test_format_file _______________________________ 265s 265s check_update = .w at 0x611fc1da05e0> 265s 265s def test_format_file(check_update): 265s > assert check_update( 265s 'assert ["aaaaaaaaaaaaaaaaa"] * 5 == snapshot()\n', flags="create" 265s ) == snapshot( 265s """\ 265s assert ["aaaaaaaaaaaaaaaaa"] * 5 == snapshot([ 265s "aaaaaaaaaaaaaaaaa", 265s "aaaaaaaaaaaaaaaaa", 265s "aaaaaaaaaaaaaaaaa", 265s "aaaaaaaaaaaaaaaaa", 265s "aaaaaaaaaaaaaaaaa", 265s ]) 265s """ 265s ) 265s 265s tests/test_inline_snapshot.py:588: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_format_file0/test_1.py:9: in 265s assert ["aaaaaaaaaaaaaaaaa"] * 5 == snapshot() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_format_file0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert ["aaaaaaaaaaaaaaaaa"] * 5 == snapshot() 265s ______________________________ test_format_value _______________________________ 265s 265s check_update = .w at 0x611fc1da0e00> 265s 265s def test_format_value(check_update): 265s > assert check_update( 265s 'assert ["aaaaaaaaaaaaaaaaa"] * 5== snapshot()\n', flags="create" 265s ) == snapshot( 265s """\ 265s assert ["aaaaaaaaaaaaaaaaa"] * 5== snapshot([ 265s "aaaaaaaaaaaaaaaaa", 265s "aaaaaaaaaaaaaaaaa", 265s "aaaaaaaaaaaaaaaaa", 265s "aaaaaaaaaaaaaaaaa", 265s "aaaaaaaaaaaaaaaaa", 265s ]) 265s """ 265s ) 265s 265s tests/test_inline_snapshot.py:604: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_format_value0/test_1.py:9: in 265s assert ["aaaaaaaaaaaaaaaaa"] * 5== snapshot() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_format_value0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert ["aaaaaaaaaaaaaaaaa"] * 5== snapshot() 265s _______________________________ test_type_error ________________________________ 265s 265s check_update = .w at 0x611fc1da3240> 265s 265s def test_type_error(check_update): 265s tests = ["5 == s", "5 <= s", "5 >= s", "5 in s", "5 == s[0]"] 265s 265s for test1, test2 in itertools.product(tests, tests): 265s with pytest.raises(TypeError) if test1 != test2 else nullcontext() as error: 265s > check_update( 265s f""" 265s s = snapshot() 265s assert {test1} 265s assert {test2} 265s """, 265s reported_flags="create", 265s ) 265s 265s tests/test_inline_snapshot.py:631: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_type_error0/test_1.py:11: in 265s assert 5 == s 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_type_error0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s | 265s |s = snapshot() 265s |assert 5 == s 265s |assert 5 == s 265s _________________________ test_different_snapshot_name _________________________ 265s 265s check_update = .w at 0x611fc1ebdbc0> 265s 265s def test_different_snapshot_name(check_update): 265s 265s assert ( 265s > check_update( 265s """\ 265s from inline_snapshot import snapshot as s 265s assert 4==s() 265s 265s """, 265s flags="create", 265s ) 265s == snapshot( 265s """\ 265s from inline_snapshot import snapshot as s 265s assert 4==s(4) 265s 265s """ 265s ) 265s ) 265s 265s tests/test_inline_snapshot.py:695: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_different_snapshot_name0/test_1.py:10: in 265s assert 4==s() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_different_snapshot_name0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |from inline_snapshot import snapshot as s 265s |assert 4==s() 265s | 265s _______________________ test_quoting_change_is_no_update _______________________ 265s 265s source = .w at 0x611fc29d3420> 265s 265s def test_quoting_change_is_no_update(source): 265s 265s > s = source( 265s """\ 265s from inline_snapshot import external,snapshot 265s 265s class X: 265s def __init__(self,a): 265s self.a=a 265s pass 265s 265s def __repr__(self): 265s return f'X("{self.a}")' 265s 265s def __eq__(self,other): 265s if not hasattr(other,"a"): 265s return NotImplemented 265s return other.a==self.a 265s 265s assert X("a") == snapshot() 265s """ 265s ) 265s 265s tests/test_inline_snapshot.py:731: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_quoting_change_is_no_upda0/test_1.py:24: in 265s assert X("a") == snapshot() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_quoting_change_is_no_upda0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |from inline_snapshot import external,snapshot 265s | 265s |class X: 265s | def __init__(self,a): 265s | self.a=a 265s | pass 265s | 265s | def __repr__(self): 265s | return f'X("{self.a}")' 265s | 265s | def __eq__(self,other): 265s | if not hasattr(other,"a"): 265s | return NotImplemented 265s | return other.a==self.a 265s | 265s |assert X("a") == snapshot() 265s _____________________________ test_trailing_comma ______________________________ 265s 265s project = .Project object at 0x611fc1ba24b0> 265s 265s def test_trailing_comma(project): 265s 265s project.setup( 265s """\ 265s from inline_snapshot import external, snapshot 265s 265s class X: 265s def __init__(self, *args): 265s self.args = args 265s 265s def __repr__(self): 265s return f"X({', '.join(map(repr,self.args))})" 265s 265s def __eq__(self,other): 265s if not isinstance(other,X): 265s return NotImplemented 265s 265s return self.args == other.args 265s 265s def test_thing(): 265s assert X("a" * 40, "a" * 40) == snapshot() 265s """ 265s ) 265s 265s > project.format() 265s 265s /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_inline_snapshot.py:805: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py:315: in format 265s format_code(self._filename.read_text("utf-8"), self._filename), "utf-8" 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s 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' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_trailing_comma0/test_file.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s write code: 265s # äöß 🐍 265s from inline_snapshot import snapshot 265s from inline_snapshot import outsource 265s from inline_snapshot import external, snapshot 265s 265s class X: 265s def __init__(self, *args): 265s self.args = args 265s 265s def __repr__(self): 265s return f"X({', '.join(map(repr,self.args))})" 265s 265s def __eq__(self,other): 265s if not isinstance(other,X): 265s return NotImplemented 265s 265s return self.args == other.args 265s 265s def test_thing(): 265s assert X("a" * 40, "a" * 40) == snapshot() 265s 265s ___________________________________ test_is ____________________________________ 265s 265s def test_is(): 265s 265s Example( 265s """ 265s from inline_snapshot import snapshot,Is 265s 265s def test_Is(): 265s for i in range(3): 265s assert ["hello",i] == snapshot(["hi",Is(i)]) 265s assert ["hello",i] == snapshot({1:["hi",Is(i)]})[i] 265s """ 265s > ).run_inline( 265s ["--inline-snapshot=create"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s 265s from inline_snapshot import snapshot,Is 265s 265s def test_Is(): 265s for i in range(3): 265s assert ["hello",i] == snapshot(["hi",Is(i)]) 265s assert ["hello",i] == snapshot({1:["hi",Is(i)], 0: ["hello", 0], 2: ["hello", 2]})[i] 265s """ 265s } 265s ), 265s ).run_inline( 265s ["--inline-snapshot=fix"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s 265s from inline_snapshot import snapshot,Is 265s 265s def test_Is(): 265s for i in range(3): 265s assert ["hello",i] == snapshot(["hello",Is(i)]) 265s assert ["hello",i] == snapshot({1:["hello",Is(i)], 0: ["hello", 0], 2: ["hello", 2]})[i] 265s """ 265s } 265s ), 265s ) 265s 265s tests/test_inline_snapshot.py:912: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = ['--inline-snapshot=create'] 265s 265s def run_inline( 265s self, 265s args: list[str] = [], 265s *, 265s reported_categories: Snapshot[list[Category]] | None = None, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s raises: Snapshot[str] | None = None, 265s ) -> Example: 265s """Execute the example files in process and run every `test_*` 265s function. 265s 265s This is useful for fast test execution. 265s 265s Parameters: 265s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 265s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 265s changed_files: snapshot of files which are changed by this run. 265s raises: snapshot of the exception which is raised during the test execution. 265s It is required if your code raises an exception. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s parser = ArgumentParser() 265s 265s parser.add_argument( 265s "--inline-snapshot", 265s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 265s dest="inline_snapshot", 265s help="update specific snapshot values:\n" 265s "disable: disable the snapshot logic\n" 265s "short-report: show a short report\n" 265s "report: show a longer report with a diff report\n" 265s "review: allow to approve the changes interactive\n" 265s "create: creates snapshots which are currently not defined\n" 265s "update: update snapshots even if they are defined\n" 265s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 265s "fix: change snapshots which currently break your tests\n", 265s ) 265s parsed_args = parser.parse_args(args) 265s flags = (parsed_args.inline_snapshot or "").split(",") 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s 265s self._write_files(tmp_path) 265s 265s raised_exception = None 265s with snapshot_env(): 265s with ChangeRecorder().activate() as recorder: 265s _inline_snapshot._update_flags = Flags({*flags}) 265s inline_snapshot._external.storage = ( 265s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 265s ) 265s 265s try: 265s for filename in tmp_path.glob("*.py"): 265s globals: dict[str, Any] = {} 265s print("run> pytest", filename) 265s exec( 265s compile(filename.read_text("utf-8"), filename, "exec"), 265s globals, 265s ) 265s 265s # run all test_* functions 265s for k, v in globals.items(): 265s if k.startswith("test_") and callable(v): 265s v() 265s except Exception as e: 265s traceback.print_exc() 265s raised_exception = e 265s 265s finally: 265s _inline_snapshot._active = False 265s 265s changes = [] 265s for snapshot in _inline_snapshot.snapshots.values(): 265s changes += snapshot._changes() 265s 265s snapshot_flags = {change.flag for change in changes} 265s 265s apply_all( 265s [ 265s change 265s for change in changes 265s if change.flag in _inline_snapshot._update_flags.to_set() 265s ] 265s ) 265s recorder.fix_all() 265s 265s report_output = StringIO() 265s console = Console(file=report_output) 265s 265s # TODO: add all the report output here 265s report_problems(console) 265s 265s if reported_categories is not None: 265s assert sorted(snapshot_flags) == reported_categories 265s 265s if raised_exception is not None: 265s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 265s raised_exception 265s ) 265s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 265s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s 265s from inline_snapshot import snapshot,Is 265s 265s def test_Is(): 265s for i in range(3): 265s assert ["hello",i] == snapshot(["hi",Is(i)]) 265s assert ["hello",i] == snapshot({1:["hi",Is(i)]})[i] 265s 265s 265s run> pytest /tmp/tmphow8dvh2/test_something.py 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 265s v() 265s File "/tmp/tmphow8dvh2/test_something.py", line 6, in test_Is 265s assert ["hello",i] == snapshot(["hi",Is(i)]) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 265s return self == other 265s ^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 265s self._changes.append(next(it)) 265s ^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py", line 79, in assign 265s v = yield from self.get_adapter( 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 265s new_code = self.context.file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s _______________________________ test_missing_is ________________________________ 265s 265s def test_missing_is(): 265s 265s Example( 265s """\ 265s from inline_snapshot import snapshot 265s 265s def test_is(): 265s for i in (1,2): 265s assert i == snapshot(i) 265s """ 265s > ).run_inline( 265s raises=snapshot( 265s """\ 265s UsageError: 265s snapshot value should not change. Use Is(...) for dynamic snapshot parts.\ 265s """ 265s ) 265s ) 265s 265s tests/test_is.py:15: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 265s assert raises == f"{type(raised_exception).__name__}:\n" + str( 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 265s filename = PosixPath('/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_is.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot 265s 265s def test_is(): 265s for i in (1,2): 265s assert i == snapshot(i) 265s 265s 265s run> pytest /tmp/tmp_5rtu578/test_something.py 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 265s v() 265s File "/tmp/tmp_5rtu578/test_something.py", line 5, in test_is 265s assert i == snapshot(i) 265s ^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 265s return self == other 265s ^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 265s self._changes.append(next(it)) 265s ^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 265s new_code = self.context.file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s __________________________________ test_repr ___________________________________ 265s 265s def test_repr(): 265s Example( 265s """\ 265s from inline_snapshot import snapshot 265s from tests._is_normalized import IsNormalized 265s 265s def test_a(): 265s n=IsNormalized(sorted,snapshot()) 265s assert [3,5,2] == n 265s assert repr(n)==snapshot() 265s """ 265s > ).run_inline( 265s ["--inline-snapshot=create"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s from inline_snapshot import snapshot 265s from tests._is_normalized import IsNormalized 265s 265s def test_a(): 265s n=IsNormalized(sorted,snapshot([2, 3, 5])) 265s assert [3,5,2] == n 265s assert repr(n)==snapshot("IsNormalized([2, 3, 5], should_be=[2, 3, 5])") 265s """ 265s } 265s ), 265s ) 265s 265s tests/test_is_normalized.py:16: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = ['--inline-snapshot=create'] 265s 265s def run_inline( 265s self, 265s args: list[str] = [], 265s *, 265s reported_categories: Snapshot[list[Category]] | None = None, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s raises: Snapshot[str] | None = None, 265s ) -> Example: 265s """Execute the example files in process and run every `test_*` 265s function. 265s 265s This is useful for fast test execution. 265s 265s Parameters: 265s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 265s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 265s changed_files: snapshot of files which are changed by this run. 265s raises: snapshot of the exception which is raised during the test execution. 265s It is required if your code raises an exception. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s parser = ArgumentParser() 265s 265s parser.add_argument( 265s "--inline-snapshot", 265s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 265s dest="inline_snapshot", 265s help="update specific snapshot values:\n" 265s "disable: disable the snapshot logic\n" 265s "short-report: show a short report\n" 265s "report: show a longer report with a diff report\n" 265s "review: allow to approve the changes interactive\n" 265s "create: creates snapshots which are currently not defined\n" 265s "update: update snapshots even if they are defined\n" 265s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 265s "fix: change snapshots which currently break your tests\n", 265s ) 265s parsed_args = parser.parse_args(args) 265s flags = (parsed_args.inline_snapshot or "").split(",") 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s 265s self._write_files(tmp_path) 265s 265s raised_exception = None 265s with snapshot_env(): 265s with ChangeRecorder().activate() as recorder: 265s _inline_snapshot._update_flags = Flags({*flags}) 265s inline_snapshot._external.storage = ( 265s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 265s ) 265s 265s try: 265s for filename in tmp_path.glob("*.py"): 265s globals: dict[str, Any] = {} 265s print("run> pytest", filename) 265s exec( 265s compile(filename.read_text("utf-8"), filename, "exec"), 265s globals, 265s ) 265s 265s # run all test_* functions 265s for k, v in globals.items(): 265s if k.startswith("test_") and callable(v): 265s v() 265s except Exception as e: 265s traceback.print_exc() 265s raised_exception = e 265s 265s finally: 265s _inline_snapshot._active = False 265s 265s changes = [] 265s for snapshot in _inline_snapshot.snapshots.values(): 265s changes += snapshot._changes() 265s 265s snapshot_flags = {change.flag for change in changes} 265s 265s apply_all( 265s [ 265s change 265s for change in changes 265s if change.flag in _inline_snapshot._update_flags.to_set() 265s ] 265s ) 265s recorder.fix_all() 265s 265s report_output = StringIO() 265s console = Console(file=report_output) 265s 265s # TODO: add all the report output here 265s report_problems(console) 265s 265s if reported_categories is not None: 265s assert sorted(snapshot_flags) == reported_categories 265s 265s if raised_exception is not None: 265s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 265s raised_exception 265s ) 265s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 265s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot 265s from tests._is_normalized import IsNormalized 265s 265s def test_a(): 265s n=IsNormalized(sorted,snapshot()) 265s assert [3,5,2] == n 265s assert repr(n)==snapshot() 265s 265s 265s run> pytest /tmp/tmpl3ccv1vc/test_something.py 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 265s v() 265s File "/tmp/tmpl3ccv1vc/test_something.py", line 6, in test_a 265s assert [3,5,2] == n 265s ^^^^^^^^^^^^ 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/_is_normalized.py", line 13, in __eq__ 265s return self._last_value == self._value 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 265s return self == other 265s ^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 265s self._changes.append(next(it)) 265s ^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 265s new_code = self.context.file._token_to_code(new_token) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 265s return format_code(text, Path(self._source.filename)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s ______________________________ test_fix_list_fix _______________________________ 265s 265s check_update = .w at 0x611fc1bf9260> 265s 265s def test_fix_list_fix(check_update): 265s > assert check_update( 265s """assert [1,2]==snapshot([0+1,3])""", reported_flags="update,fix", flags="fix" 265s ) == snapshot("assert [1,2]==snapshot([0+1,2])") 265s 265s tests/test_preserve_values.py:9: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_fix_list_fix0/test_1.py:9: in 265s assert [1,2]==snapshot([0+1,3]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '1 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_list_fix0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [1,2]==snapshot([0+1,3]) 265s _____________________________ test_fix_list_insert _____________________________ 265s 265s check_update = .w at 0x611fc1da2de0> 265s 265s def test_fix_list_insert(check_update): 265s > assert check_update( 265s """assert [1,2,3,4,5,6]==snapshot([0+1,3])""", 265s reported_flags="update,fix", 265s flags="fix", 265s ) == snapshot("assert [1,2,3,4,5,6]==snapshot([0+1, 2, 3, 4, 5, 6])") 265s 265s tests/test_preserve_values.py:15: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_fix_list_insert0/test_1.py:9: in 265s assert [1,2,3,4,5,6]==snapshot([0+1,3]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '1 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_list_insert0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [1,2,3,4,5,6]==snapshot([0+1,3]) 265s _____________________________ test_fix_list_delete _____________________________ 265s 265s check_update = .w at 0x611fc1bf0c20> 265s 265s def test_fix_list_delete(check_update): 265s > assert check_update( 265s """assert [1,5]==snapshot([0+1,2,3,4,5])""", 265s reported_flags="update,fix", 265s flags="fix", 265s ) == snapshot("assert [1,5]==snapshot([0+1, 5])") 265s 265s tests/test_preserve_values.py:23: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_fix_list_delete0/test_1.py:9: in 265s assert [1,5]==snapshot([0+1,2,3,4,5]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '1 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_list_delete0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [1,5]==snapshot([0+1,2,3,4,5]) 265s ____________________________ test_fix_tuple_delete _____________________________ 265s 265s check_update = .w at 0x611fc1da2de0> 265s 265s def test_fix_tuple_delete(check_update): 265s > assert check_update( 265s """assert (1,5)==snapshot((0+1,2,3,4,5))""", 265s reported_flags="update,fix", 265s flags="fix", 265s ) == snapshot("assert (1,5)==snapshot((0+1, 5))") 265s 265s tests/test_preserve_values.py:31: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_fix_tuple_delete0/test_1.py:9: in 265s assert (1,5)==snapshot((0+1,2,3,4,5)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '1 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_tuple_delete0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (1,5)==snapshot((0+1,2,3,4,5)) 265s _____________________________ test_fix_dict_change _____________________________ 265s 265s check_update = .w at 0x611fc1bf0540> 265s 265s def test_fix_dict_change(check_update): 265s > assert check_update( 265s """assert {1:1, 2:2}==snapshot({1:0+1, 2:3})""", 265s reported_flags="update,fix", 265s flags="fix", 265s ) == snapshot("assert {1:1, 2:2}==snapshot({1:0+1, 2:2})") 265s 265s tests/test_preserve_values.py:39: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_change0/test_1.py:9: in 265s assert {1:1, 2:2}==snapshot({1:0+1, 2:3}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '1 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_change0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {1:1, 2:2}==snapshot({1:0+1, 2:3}) 265s _____________________________ test_fix_dict_remove _____________________________ 265s 265s check_update = .w at 0x611fc1bf0860> 265s 265s def test_fix_dict_remove(check_update): 265s > assert check_update( 265s """assert {1:1}==snapshot({0:0, 1:0+1, 2:2})""", 265s reported_flags="update,fix", 265s flags="fix", 265s ) == snapshot("assert {1:1}==snapshot({1:0+1})") 265s 265s tests/test_preserve_values.py:47: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_remove0/test_1.py:9: in 265s assert {1:1}==snapshot({0:0, 1:0+1, 2:2}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '1 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_remove0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {1:1}==snapshot({0:0, 1:0+1, 2:2}) 265s _____________________________ test_fix_dict_insert _____________________________ 265s 265s check_update = .w at 0x611fc1bf0d60> 265s 265s def test_fix_dict_insert(check_update): 265s > assert check_update( 265s """assert {0:"before",1:1,2:"after"}==snapshot({1:0+1})""", 265s reported_flags="update,fix", 265s flags="fix", 265s ) == snapshot( 265s 'assert {0:"before",1:1,2:"after"}==snapshot({0: "before", 1:0+1, 2: "after"})' 265s ) 265s 265s tests/test_preserve_values.py:61: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_insert0/test_1.py:9: in 265s assert {0:"before",1:1,2:"after"}==snapshot({1:0+1}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '1 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_insert0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0:"before",1:1,2:"after"}==snapshot({1:0+1}) 265s _____________________ test_fix_dict_with_non_literal_keys ______________________ 265s 265s check_update = .w at 0x611fc1bf2ac0> 265s 265s def test_fix_dict_with_non_literal_keys(check_update): 265s > assert check_update( 265s """assert {1+2:"3"}==snapshot({1+2:"5"})""", 265s reported_flags="fix", 265s flags="fix", 265s ) == snapshot('assert {1+2:"3"}==snapshot({1+2:"3"})') 265s 265s tests/test_preserve_values.py:71: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_with_non_literal0/test_1.py:9: in 265s assert {1+2:"3"}==snapshot({1+2:"5"}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = "'3'" 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_with_non_literal0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {1+2:"3"}==snapshot({1+2:"5"}) 265s _______________________ test_no_update_for_dirty_equals ________________________ 265s 265s check_update = .w at 0x611fc1bf3380> 265s 265s @pytest.mark.skipif( 265s sys.version_info < (3, 8), reason="dirty equals has dropped the 3.7 support" 265s ) 265s def test_no_update_for_dirty_equals(check_update): 265s assert ( 265s > check_update( 265s """\ 265s from dirty_equals import IsInt 265s assert {5:5,2:2}==snapshot({5:IsInt(),2:1+1}) 265s """, 265s reported_flags="update", 265s flags="update", 265s ) 265s == snapshot( 265s """\ 265s from dirty_equals import IsInt 265s assert {5:5,2:2}==snapshot({5:IsInt(),2:2}) 265s """ 265s ) 265s ) 265s 265s tests/test_preserve_values.py:83: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_no_update_for_dirty_equal0/test_1.py:10: in 265s assert {5:5,2:2}==snapshot({5:IsInt(),2:1+1}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '2 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_no_update_for_dirty_equal0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |from dirty_equals import IsInt 265s |assert {5:5,2:2}==snapshot({5:IsInt(),2:1+1}) 265s _____________________ test_preserve_case_from_original_mr ______________________ 265s 265s check_update = .w at 0x611fc1bf1080> 265s 265s def test_preserve_case_from_original_mr(check_update): 265s assert ( 265s > check_update( 265s """\ 265s left = { 265s "a": 1, 265s "b": { 265s "c": 2, 265s "d": [ 265s 3, 265s 4, 265s 5, 265s ], 265s }, 265s "e": ( 265s { 265s "f": 6, 265s "g": 7, 265s }, 265s ), 265s } 265s assert left == snapshot( 265s { 265s "a": 10, 265s "b": { 265s "c": 2 * 1 + 0, 265s "d": [ 265s int(3), 265s 40, 265s 5, 265s ], 265s "h": 8, 265s }, 265s "e": ( 265s { 265s "f": 3 + 3, 265s }, 265s 9, 265s ), 265s } 265s ) 265s """, 265s reported_flags="update,fix", 265s flags="fix", 265s ) 265s == snapshot( 265s """\ 265s left = { 265s "a": 1, 265s "b": { 265s "c": 2, 265s "d": [ 265s 3, 265s 4, 265s 5, 265s ], 265s }, 265s "e": ( 265s { 265s "f": 6, 265s "g": 7, 265s }, 265s ), 265s } 265s assert left == snapshot( 265s { 265s "a": 1, 265s "b": { 265s "c": 2 * 1 + 0, 265s "d": [ 265s int(3), 265s 4, 265s 5, 265s ]}, 265s "e": ({"f": 6, "g": 7},), 265s } 265s ) 265s """ 265s ) 265s ) 265s 265s tests/test_preserve_values.py:103: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_preserve_case_from_origin0/test_1.py:26: in 265s assert left == snapshot( 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '1 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_preserve_case_from_origin0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |left = { 265s | "a": 1, 265s | "b": { 265s | "c": 2, 265s | "d": [ 265s | 3, 265s | 4, 265s | 5, 265s | ], 265s | }, 265s | "e": ( 265s | { 265s | "f": 6, 265s | "g": 7, 265s | }, 265s | ), 265s |} 265s |assert left == snapshot( 265s | { 265s | "a": 10, 265s | "b": { 265s | "c": 2 * 1 + 0, 265s | "d": [ 265s | int(3), 265s | 40, 265s | 5, 265s | ], 265s | "h": 8, 265s | }, 265s | "e": ( 265s | { 265s | "f": 3 + 3, 265s | }, 265s | 9, 265s | ), 265s | } 265s |) 265s _____________________ test_generic [[5, 5, 5] -> [] ] _____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s s1 = source(code) 265s print("source:", code) 265s 265s assert set(s1.flags) == flags 265s 265s assert ("fix" in flags) == s1.error 265s 265s for f in all_flags: 265s c3 = build( 265s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 265s ) 265s new_code = f"assert {c2}==snapshot({c3})" 265s 265s print(f"{set(f)}:") 265s print(" ", code) 265s print(" ", new_code) 265s > s2 = s1.run(*f) 265s 265s tests/test_preserve_values.py:245: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:137: in run 265s recorder.fix_all() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 265s file.rewrite() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 265s new_code = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s 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])' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_3.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert []==snapshot([5, 5, 5]) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert []==snapshot([5, 5, 5]) 265s source: assert []==snapshot([5, 5, 5]) 265s set(): 265s assert []==snapshot([5, 5, 5]) 265s assert []==snapshot([5, 5, 5]) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert []==snapshot([5, 5, 5]) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert []==snapshot([5, 5, 5]) 265s {'fix'}: 265s assert []==snapshot([5, 5, 5]) 265s assert []==snapshot([]) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert []==snapshot([5, 5, 5]) 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_1.py", line 9, in 265s assert []==snapshot([5, 5, 5]) 265s ^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_2.py", line 9, in 265s assert []==snapshot([5, 5, 5]) 265s ^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________________ test_generic [[5, 5] -> [8] ] ______________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_4.py:9: in 265s assert [8]==snapshot([5, 5]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_4.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [8]==snapshot([5, 5]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [[5, 5, 2+2] -> [4] ] ________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_5.py:9: in 265s assert [4]==snapshot([5, 5, 2+2]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_5.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [4]==snapshot([5, 5, 2+2]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________________ test_generic [[5, 5, 3] -> [3] ] _____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s s1 = source(code) 265s print("source:", code) 265s 265s assert set(s1.flags) == flags 265s 265s assert ("fix" in flags) == s1.error 265s 265s for f in all_flags: 265s c3 = build( 265s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 265s ) 265s new_code = f"assert {c2}==snapshot({c3})" 265s 265s print(f"{set(f)}:") 265s print(" ", code) 265s print(" ", new_code) 265s > s2 = s1.run(*f) 265s 265s tests/test_preserve_values.py:245: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:137: in run 265s recorder.fix_all() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 265s file.rewrite() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 265s new_code = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s 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])' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_8.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3]==snapshot([5, 5, 3]) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert [3]==snapshot([5, 5, 3]) 265s source: assert [3]==snapshot([5, 5, 3]) 265s set(): 265s assert [3]==snapshot([5, 5, 3]) 265s assert [3]==snapshot([5, 5, 3]) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3]==snapshot([5, 5, 3]) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert [3]==snapshot([5, 5, 3]) 265s {'fix'}: 265s assert [3]==snapshot([5, 5, 3]) 265s assert [3]==snapshot([3]) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3]==snapshot([5, 5, 3]) 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_6.py", line 9, in 265s assert [3]==snapshot([5, 5, 3]) 265s ^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_7.py", line 9, in 265s assert [3]==snapshot([5, 5, 3]) 265s ^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________________ test_generic [[5, 5] -> [8] ] ______________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_9.py:9: in 265s assert [8]==snapshot([5, 5]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_9.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [8]==snapshot([5, 5]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________________ test_generic [[5] -> [8, 8] ] ______________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_10.py:9: in 265s assert [8, 8]==snapshot([5]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_10.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [8, 8]==snapshot([5]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [[5, 2+2] -> [8, 4] ] ________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_11.py:9: in 265s assert [8, 4]==snapshot([5, 2+2]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_11.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [8, 4]==snapshot([5, 2+2]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________________ test_generic [[5, 3] -> [8, 3] ] _____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_12.py:9: in 265s assert [8, 3]==snapshot([5, 3]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_12.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [8, 3]==snapshot([5, 3]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [[5, 2+2, 5] -> [4] ] ________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_13.py:9: in 265s assert [4]==snapshot([5, 2+2, 5]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_13.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [4]==snapshot([5, 2+2, 5]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [[5, 2+2] -> [4, 8] ] ________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_14.py:9: in 265s assert [4, 8]==snapshot([5, 2+2]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_14.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [4, 8]==snapshot([5, 2+2]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____________ test_generic [[5, 2+2, 2+2] -> [4, 4] ] _____________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_15.py:9: in 265s assert [4, 4]==snapshot([5, 2+2, 2+2]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_15.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [4, 4]==snapshot([5, 2+2, 2+2]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [[5, 2+2, 3] -> [4, 3] ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_16.py:9: in 265s assert [4, 3]==snapshot([5, 2+2, 3]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_16.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [4, 3]==snapshot([5, 2+2, 3]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________________ test_generic [[5, 3, 5] -> [3] ] _____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s s1 = source(code) 265s print("source:", code) 265s 265s assert set(s1.flags) == flags 265s 265s assert ("fix" in flags) == s1.error 265s 265s for f in all_flags: 265s c3 = build( 265s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 265s ) 265s new_code = f"assert {c2}==snapshot({c3})" 265s 265s print(f"{set(f)}:") 265s print(" ", code) 265s print(" ", new_code) 265s > s2 = s1.run(*f) 265s 265s tests/test_preserve_values.py:245: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:137: in run 265s recorder.fix_all() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 265s file.rewrite() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 265s new_code = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s 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])' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_19.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3]==snapshot([5, 3, 5]) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert [3]==snapshot([5, 3, 5]) 265s source: assert [3]==snapshot([5, 3, 5]) 265s set(): 265s assert [3]==snapshot([5, 3, 5]) 265s assert [3]==snapshot([5, 3, 5]) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3]==snapshot([5, 3, 5]) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert [3]==snapshot([5, 3, 5]) 265s {'fix'}: 265s assert [3]==snapshot([5, 3, 5]) 265s assert [3]==snapshot([3]) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3]==snapshot([5, 3, 5]) 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_17.py", line 9, in 265s assert [3]==snapshot([5, 3, 5]) 265s ^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_18.py", line 9, in 265s assert [3]==snapshot([5, 3, 5]) 265s ^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________________ test_generic [[5, 3] -> [3, 8] ] _____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_20.py:9: in 265s assert [3, 8]==snapshot([5, 3]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_20.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3, 8]==snapshot([5, 3]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [[5, 3, 2+2] -> [3, 4] ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_21.py:9: in 265s assert [3, 4]==snapshot([5, 3, 2+2]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_21.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3, 4]==snapshot([5, 3, 2+2]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ___________________ test_generic [[5, 3, 3] -> [3, 3] ] ___________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s s1 = source(code) 265s print("source:", code) 265s 265s assert set(s1.flags) == flags 265s 265s assert ("fix" in flags) == s1.error 265s 265s for f in all_flags: 265s c3 = build( 265s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 265s ) 265s new_code = f"assert {c2}==snapshot({c3})" 265s 265s print(f"{set(f)}:") 265s print(" ", code) 265s print(" ", new_code) 265s > s2 = s1.run(*f) 265s 265s tests/test_preserve_values.py:245: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:137: in run 265s recorder.fix_all() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 265s file.rewrite() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 265s new_code = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s 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])' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_24.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3, 3]==snapshot([5, 3, 3]) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert [3, 3]==snapshot([5, 3, 3]) 265s source: assert [3, 3]==snapshot([5, 3, 3]) 265s set(): 265s assert [3, 3]==snapshot([5, 3, 3]) 265s assert [3, 3]==snapshot([5, 3, 3]) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3, 3]==snapshot([5, 3, 3]) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert [3, 3]==snapshot([5, 3, 3]) 265s {'fix'}: 265s assert [3, 3]==snapshot([5, 3, 3]) 265s assert [3, 3]==snapshot([3, 3]) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3, 3]==snapshot([5, 3, 3]) 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_22.py", line 9, in 265s assert [3, 3]==snapshot([5, 3, 3]) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_23.py", line 9, in 265s assert [3, 3]==snapshot([5, 3, 3]) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________________ test_generic [[5, 5] -> [8] ] ______________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_25.py:9: in 265s assert [8]==snapshot([5, 5]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_25.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [8]==snapshot([5, 5]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________________ test_generic [[5] -> [8, 8] ] ______________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_26.py:9: in 265s assert [8, 8]==snapshot([5]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_26.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [8, 8]==snapshot([5]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [[5, 2+2] -> [8, 4] ] ________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_27.py:9: in 265s assert [8, 4]==snapshot([5, 2+2]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_27.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [8, 4]==snapshot([5, 2+2]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________________ test_generic [[5, 3] -> [8, 3] ] _____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_28.py:9: in 265s assert [8, 3]==snapshot([5, 3]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_28.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [8, 3]==snapshot([5, 3]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________________ test_generic [[5] -> [8, 8] ] ______________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_29.py:9: in 265s assert [8, 8]==snapshot([5]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_29.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [8, 8]==snapshot([5]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____________________ test_generic [[] -> [8, 8, 8] ] _____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_30.py:9: in 265s assert [8, 8, 8]==snapshot([]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_30.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [8, 8, 8]==snapshot([]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [[2+2] -> [8, 8, 4] ] ________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_31.py:9: in 265s assert [8, 8, 4]==snapshot([2+2]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_31.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [8, 8, 4]==snapshot([2+2]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________________ test_generic [[3] -> [8, 8, 3] ] _____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_32.py:9: in 265s assert [8, 8, 3]==snapshot([3]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_32.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [8, 8, 3]==snapshot([3]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [[2+2, 5] -> [8, 4] ] ________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_33.py:9: in 265s assert [8, 4]==snapshot([2+2, 5]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_33.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [8, 4]==snapshot([2+2, 5]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [[2+2] -> [8, 4, 8] ] ________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_34.py:9: in 265s assert [8, 4, 8]==snapshot([2+2]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_34.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [8, 4, 8]==snapshot([2+2]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____________ test_generic [[2+2, 2+2] -> [8, 4, 4] ] _____________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_35.py:9: in 265s assert [8, 4, 4]==snapshot([2+2, 2+2]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_35.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [8, 4, 4]==snapshot([2+2, 2+2]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [[2+2, 3] -> [8, 4, 3] ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_36.py:9: in 265s assert [8, 4, 3]==snapshot([2+2, 3]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_36.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [8, 4, 3]==snapshot([2+2, 3]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________________ test_generic [[3, 5] -> [8, 3] ] _____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_37.py:9: in 265s assert [8, 3]==snapshot([3, 5]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_37.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [8, 3]==snapshot([3, 5]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________________ test_generic [[3] -> [8, 3, 8] ] _____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_38.py:9: in 265s assert [8, 3, 8]==snapshot([3]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_38.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [8, 3, 8]==snapshot([3]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [[3, 2+2] -> [8, 3, 4] ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_39.py:9: in 265s assert [8, 3, 4]==snapshot([3, 2+2]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_39.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [8, 3, 4]==snapshot([3, 2+2]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ___________________ test_generic [[3, 3] -> [8, 3, 3] ] ___________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_40.py:9: in 265s assert [8, 3, 3]==snapshot([3, 3]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_40.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [8, 3, 3]==snapshot([3, 3]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [[2+2, 5, 5] -> [4] ] ________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_41.py:9: in 265s assert [4]==snapshot([2+2, 5, 5]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_41.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [4]==snapshot([2+2, 5, 5]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [[2+2, 5] -> [4, 8] ] ________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_42.py:9: in 265s assert [4, 8]==snapshot([2+2, 5]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_42.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [4, 8]==snapshot([2+2, 5]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____________ test_generic [[2+2, 5, 2+2] -> [4, 4] ] _____________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_43.py:9: in 265s assert [4, 4]==snapshot([2+2, 5, 2+2]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_43.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [4, 4]==snapshot([2+2, 5, 2+2]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [[2+2, 5, 3] -> [4, 3] ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_44.py:9: in 265s assert [4, 3]==snapshot([2+2, 5, 3]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_44.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [4, 3]==snapshot([2+2, 5, 3]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [[2+2, 5] -> [4, 8] ] ________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_45.py:9: in 265s assert [4, 8]==snapshot([2+2, 5]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_45.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [4, 8]==snapshot([2+2, 5]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [[2+2] -> [4, 8, 8] ] ________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_46.py:9: in 265s assert [4, 8, 8]==snapshot([2+2]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_46.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [4, 8, 8]==snapshot([2+2]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____________ test_generic [[2+2, 2+2] -> [4, 8, 4] ] _____________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_47.py:9: in 265s assert [4, 8, 4]==snapshot([2+2, 2+2]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_47.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [4, 8, 4]==snapshot([2+2, 2+2]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [[2+2, 3] -> [4, 8, 3] ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_48.py:9: in 265s assert [4, 8, 3]==snapshot([2+2, 3]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_48.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [4, 8, 3]==snapshot([2+2, 3]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____________ test_generic [[2+2, 2+2, 5] -> [4, 4] ] _____________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_49.py:9: in 265s assert [4, 4]==snapshot([2+2, 2+2, 5]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_49.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [4, 4]==snapshot([2+2, 2+2, 5]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____________ test_generic [[2+2, 2+2] -> [4, 4, 8] ] _____________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_50.py:9: in 265s assert [4, 4, 8]==snapshot([2+2, 2+2]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_50.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [4, 4, 8]==snapshot([2+2, 2+2]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____________ test_generic [[2+2, 2+2, 2+2] -> [4, 4, 4] ] _____________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_51.py:9: in 265s assert [4, 4, 4]==snapshot([2+2, 2+2, 2+2]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_51.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [4, 4, 4]==snapshot([2+2, 2+2, 2+2]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [[2+2, 2+2, 3] -> [4, 4, 3] ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_52.py:9: in 265s assert [4, 4, 3]==snapshot([2+2, 2+2, 3]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_52.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [4, 4, 3]==snapshot([2+2, 2+2, 3]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [[2+2, 3, 5] -> [4, 3] ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_53.py:9: in 265s assert [4, 3]==snapshot([2+2, 3, 5]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_53.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [4, 3]==snapshot([2+2, 3, 5]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [[2+2, 3] -> [4, 3, 8] ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_54.py:9: in 265s assert [4, 3, 8]==snapshot([2+2, 3]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_54.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [4, 3, 8]==snapshot([2+2, 3]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [[2+2, 3, 2+2] -> [4, 3, 4] ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_55.py:9: in 265s assert [4, 3, 4]==snapshot([2+2, 3, 2+2]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_55.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [4, 3, 4]==snapshot([2+2, 3, 2+2]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [[2+2, 3, 3] -> [4, 3, 3] ] _______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_56.py:9: in 265s assert [4, 3, 3]==snapshot([2+2, 3, 3]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_56.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [4, 3, 3]==snapshot([2+2, 3, 3]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________________ test_generic [[3, 5, 5] -> [3] ] _____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s s1 = source(code) 265s print("source:", code) 265s 265s assert set(s1.flags) == flags 265s 265s assert ("fix" in flags) == s1.error 265s 265s for f in all_flags: 265s c3 = build( 265s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 265s ) 265s new_code = f"assert {c2}==snapshot({c3})" 265s 265s print(f"{set(f)}:") 265s print(" ", code) 265s print(" ", new_code) 265s > s2 = s1.run(*f) 265s 265s tests/test_preserve_values.py:245: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:137: in run 265s recorder.fix_all() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 265s file.rewrite() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 265s new_code = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s 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])' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_59.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3]==snapshot([3, 5, 5]) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert [3]==snapshot([3, 5, 5]) 265s source: assert [3]==snapshot([3, 5, 5]) 265s set(): 265s assert [3]==snapshot([3, 5, 5]) 265s assert [3]==snapshot([3, 5, 5]) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3]==snapshot([3, 5, 5]) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert [3]==snapshot([3, 5, 5]) 265s {'fix'}: 265s assert [3]==snapshot([3, 5, 5]) 265s assert [3]==snapshot([3]) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3]==snapshot([3, 5, 5]) 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_57.py", line 9, in 265s assert [3]==snapshot([3, 5, 5]) 265s ^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_58.py", line 9, in 265s assert [3]==snapshot([3, 5, 5]) 265s ^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________________ test_generic [[3, 5] -> [3, 8] ] _____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_60.py:9: in 265s assert [3, 8]==snapshot([3, 5]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_60.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3, 8]==snapshot([3, 5]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [[3, 5, 2+2] -> [3, 4] ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_61.py:9: in 265s assert [3, 4]==snapshot([3, 5, 2+2]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_61.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3, 4]==snapshot([3, 5, 2+2]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ___________________ test_generic [[3, 5, 3] -> [3, 3] ] ___________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s s1 = source(code) 265s print("source:", code) 265s 265s assert set(s1.flags) == flags 265s 265s assert ("fix" in flags) == s1.error 265s 265s for f in all_flags: 265s c3 = build( 265s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 265s ) 265s new_code = f"assert {c2}==snapshot({c3})" 265s 265s print(f"{set(f)}:") 265s print(" ", code) 265s print(" ", new_code) 265s > s2 = s1.run(*f) 265s 265s tests/test_preserve_values.py:245: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:137: in run 265s recorder.fix_all() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 265s file.rewrite() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 265s new_code = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s 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])' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_64.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3, 3]==snapshot([3, 5, 3]) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert [3, 3]==snapshot([3, 5, 3]) 265s source: assert [3, 3]==snapshot([3, 5, 3]) 265s set(): 265s assert [3, 3]==snapshot([3, 5, 3]) 265s assert [3, 3]==snapshot([3, 5, 3]) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3, 3]==snapshot([3, 5, 3]) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert [3, 3]==snapshot([3, 5, 3]) 265s {'fix'}: 265s assert [3, 3]==snapshot([3, 5, 3]) 265s assert [3, 3]==snapshot([3, 3]) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3, 3]==snapshot([3, 5, 3]) 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_62.py", line 9, in 265s assert [3, 3]==snapshot([3, 5, 3]) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_63.py", line 9, in 265s assert [3, 3]==snapshot([3, 5, 3]) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________________ test_generic [[3, 5] -> [3, 8] ] _____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_65.py:9: in 265s assert [3, 8]==snapshot([3, 5]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_65.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3, 8]==snapshot([3, 5]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________________ test_generic [[3] -> [3, 8, 8] ] _____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_66.py:9: in 265s assert [3, 8, 8]==snapshot([3]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_66.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3, 8, 8]==snapshot([3]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [[3, 2+2] -> [3, 8, 4] ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_67.py:9: in 265s assert [3, 8, 4]==snapshot([3, 2+2]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_67.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3, 8, 4]==snapshot([3, 2+2]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ___________________ test_generic [[3, 3] -> [3, 8, 3] ] ___________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_68.py:9: in 265s assert [3, 8, 3]==snapshot([3, 3]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_68.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3, 8, 3]==snapshot([3, 3]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [[3, 2+2, 5] -> [3, 4] ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_69.py:9: in 265s assert [3, 4]==snapshot([3, 2+2, 5]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_69.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3, 4]==snapshot([3, 2+2, 5]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [[3, 2+2] -> [3, 4, 8] ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_70.py:9: in 265s assert [3, 4, 8]==snapshot([3, 2+2]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_70.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3, 4, 8]==snapshot([3, 2+2]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [[3, 2+2, 2+2] -> [3, 4, 4] ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_71.py:9: in 265s assert [3, 4, 4]==snapshot([3, 2+2, 2+2]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_71.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3, 4, 4]==snapshot([3, 2+2, 2+2]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [[3, 2+2, 3] -> [3, 4, 3] ] _______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_72.py:9: in 265s assert [3, 4, 3]==snapshot([3, 2+2, 3]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_72.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3, 4, 3]==snapshot([3, 2+2, 3]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ___________________ test_generic [[3, 3, 5] -> [3, 3] ] ___________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s s1 = source(code) 265s print("source:", code) 265s 265s assert set(s1.flags) == flags 265s 265s assert ("fix" in flags) == s1.error 265s 265s for f in all_flags: 265s c3 = build( 265s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 265s ) 265s new_code = f"assert {c2}==snapshot({c3})" 265s 265s print(f"{set(f)}:") 265s print(" ", code) 265s print(" ", new_code) 265s > s2 = s1.run(*f) 265s 265s tests/test_preserve_values.py:245: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:137: in run 265s recorder.fix_all() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 265s file.rewrite() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 265s new_code = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s 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])' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_75.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3, 3]==snapshot([3, 3, 5]) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert [3, 3]==snapshot([3, 3, 5]) 265s source: assert [3, 3]==snapshot([3, 3, 5]) 265s set(): 265s assert [3, 3]==snapshot([3, 3, 5]) 265s assert [3, 3]==snapshot([3, 3, 5]) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3, 3]==snapshot([3, 3, 5]) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert [3, 3]==snapshot([3, 3, 5]) 265s {'fix'}: 265s assert [3, 3]==snapshot([3, 3, 5]) 265s assert [3, 3]==snapshot([3, 3]) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3, 3]==snapshot([3, 3, 5]) 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_73.py", line 9, in 265s assert [3, 3]==snapshot([3, 3, 5]) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_74.py", line 9, in 265s assert [3, 3]==snapshot([3, 3, 5]) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s ------------------------------ Captured log call ------------------------------- 265s 265s ___________________ test_generic [[3, 3] -> [3, 3, 8] ] ___________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_76.py:9: in 265s assert [3, 3, 8]==snapshot([3, 3]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_76.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3, 3, 8]==snapshot([3, 3]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [[3, 3, 2+2] -> [3, 3, 4] ] _______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_77.py:9: in 265s assert [3, 3, 4]==snapshot([3, 3, 2+2]) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_77.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert [3, 3, 4]==snapshot([3, 3, 2+2]) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____________________ test_generic [(5, 5, 5) -> () ] _____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s s1 = source(code) 265s print("source:", code) 265s 265s assert set(s1.flags) == flags 265s 265s assert ("fix" in flags) == s1.error 265s 265s for f in all_flags: 265s c3 = build( 265s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 265s ) 265s new_code = f"assert {c2}==snapshot({c3})" 265s 265s print(f"{set(f)}:") 265s print(" ", code) 265s print(" ", new_code) 265s > s2 = s1.run(*f) 265s 265s tests/test_preserve_values.py:245: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:137: in run 265s recorder.fix_all() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 265s file.rewrite() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 265s new_code = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s 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))' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_82.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert ()==snapshot((5, 5, 5)) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert ()==snapshot((5, 5, 5)) 265s source: assert ()==snapshot((5, 5, 5)) 265s set(): 265s assert ()==snapshot((5, 5, 5)) 265s assert ()==snapshot((5, 5, 5)) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert ()==snapshot((5, 5, 5)) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert ()==snapshot((5, 5, 5)) 265s {'fix'}: 265s assert ()==snapshot((5, 5, 5)) 265s assert ()==snapshot(()) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert ()==snapshot((5, 5, 5)) 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_80.py", line 9, in 265s assert ()==snapshot((5, 5, 5)) 265s ^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_81.py", line 9, in 265s assert ()==snapshot((5, 5, 5)) 265s ^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____________________ test_generic [(5, 5) -> (8,) ] ______________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_83.py:9: in 265s assert (8,)==snapshot((5, 5)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_83.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (8,)==snapshot((5, 5)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [(5, 5, 2+2) -> (4,) ] _______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_84.py:9: in 265s assert (4,)==snapshot((5, 5, 2+2)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_84.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (4,)==snapshot((5, 5, 2+2)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________________ test_generic [(5, 5, 3) -> (3,) ] ____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s s1 = source(code) 265s print("source:", code) 265s 265s assert set(s1.flags) == flags 265s 265s assert ("fix" in flags) == s1.error 265s 265s for f in all_flags: 265s c3 = build( 265s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 265s ) 265s new_code = f"assert {c2}==snapshot({c3})" 265s 265s print(f"{set(f)}:") 265s print(" ", code) 265s print(" ", new_code) 265s > s2 = s1.run(*f) 265s 265s tests/test_preserve_values.py:245: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:137: in run 265s recorder.fix_all() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 265s file.rewrite() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 265s new_code = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s 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))' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_87.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3,)==snapshot((5, 5, 3)) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert (3,)==snapshot((5, 5, 3)) 265s source: assert (3,)==snapshot((5, 5, 3)) 265s set(): 265s assert (3,)==snapshot((5, 5, 3)) 265s assert (3,)==snapshot((5, 5, 3)) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3,)==snapshot((5, 5, 3)) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert (3,)==snapshot((5, 5, 3)) 265s {'fix'}: 265s assert (3,)==snapshot((5, 5, 3)) 265s assert (3,)==snapshot((3,)) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3,)==snapshot((5, 5, 3)) 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_85.py", line 9, in 265s assert (3,)==snapshot((5, 5, 3)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_86.py", line 9, in 265s assert (3,)==snapshot((5, 5, 3)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____________________ test_generic [(5, 5) -> (8,) ] ______________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_88.py:9: in 265s assert (8,)==snapshot((5, 5)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_88.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (8,)==snapshot((5, 5)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____________________ test_generic [(5,) -> (8, 8) ] ______________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_89.py:9: in 265s assert (8, 8)==snapshot((5,)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_89.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (8, 8)==snapshot((5,)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [(5, 2+2) -> (8, 4) ] ________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_90.py:9: in 265s assert (8, 4)==snapshot((5, 2+2)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_90.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (8, 4)==snapshot((5, 2+2)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________________ test_generic [(5, 3) -> (8, 3) ] _____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_91.py:9: in 265s assert (8, 3)==snapshot((5, 3)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_91.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (8, 3)==snapshot((5, 3)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [(5, 2+2, 5) -> (4,) ] _______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_92.py:9: in 265s assert (4,)==snapshot((5, 2+2, 5)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_92.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (4,)==snapshot((5, 2+2, 5)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [(5, 2+2) -> (4, 8) ] ________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_93.py:9: in 265s assert (4, 8)==snapshot((5, 2+2)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_93.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (4, 8)==snapshot((5, 2+2)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____________ test_generic [(5, 2+2, 2+2) -> (4, 4) ] _____________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_94.py:9: in 265s assert (4, 4)==snapshot((5, 2+2, 2+2)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_94.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (4, 4)==snapshot((5, 2+2, 2+2)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [(5, 2+2, 3) -> (4, 3) ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_95.py:9: in 265s assert (4, 3)==snapshot((5, 2+2, 3)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_95.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (4, 3)==snapshot((5, 2+2, 3)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________________ test_generic [(5, 3, 5) -> (3,) ] ____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s s1 = source(code) 265s print("source:", code) 265s 265s assert set(s1.flags) == flags 265s 265s assert ("fix" in flags) == s1.error 265s 265s for f in all_flags: 265s c3 = build( 265s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 265s ) 265s new_code = f"assert {c2}==snapshot({c3})" 265s 265s print(f"{set(f)}:") 265s print(" ", code) 265s print(" ", new_code) 265s > s2 = s1.run(*f) 265s 265s tests/test_preserve_values.py:245: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:137: in run 265s recorder.fix_all() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 265s file.rewrite() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 265s new_code = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s 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))' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_98.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3,)==snapshot((5, 3, 5)) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert (3,)==snapshot((5, 3, 5)) 265s source: assert (3,)==snapshot((5, 3, 5)) 265s set(): 265s assert (3,)==snapshot((5, 3, 5)) 265s assert (3,)==snapshot((5, 3, 5)) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3,)==snapshot((5, 3, 5)) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert (3,)==snapshot((5, 3, 5)) 265s {'fix'}: 265s assert (3,)==snapshot((5, 3, 5)) 265s assert (3,)==snapshot((3,)) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3,)==snapshot((5, 3, 5)) 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_96.py", line 9, in 265s assert (3,)==snapshot((5, 3, 5)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_97.py", line 9, in 265s assert (3,)==snapshot((5, 3, 5)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________________ test_generic [(5, 3) -> (3, 8) ] _____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_99.py:9: in 265s assert (3, 8)==snapshot((5, 3)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_99.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3, 8)==snapshot((5, 3)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [(5, 3, 2+2) -> (3, 4) ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_100.py:9: in 265s assert (3, 4)==snapshot((5, 3, 2+2)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_100.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3, 4)==snapshot((5, 3, 2+2)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ___________________ test_generic [(5, 3, 3) -> (3, 3) ] ___________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s s1 = source(code) 265s print("source:", code) 265s 265s assert set(s1.flags) == flags 265s 265s assert ("fix" in flags) == s1.error 265s 265s for f in all_flags: 265s c3 = build( 265s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 265s ) 265s new_code = f"assert {c2}==snapshot({c3})" 265s 265s print(f"{set(f)}:") 265s print(" ", code) 265s print(" ", new_code) 265s > s2 = s1.run(*f) 265s 265s tests/test_preserve_values.py:245: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:137: in run 265s recorder.fix_all() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 265s file.rewrite() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 265s new_code = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s 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))' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_103.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3, 3)==snapshot((5, 3, 3)) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert (3, 3)==snapshot((5, 3, 3)) 265s source: assert (3, 3)==snapshot((5, 3, 3)) 265s set(): 265s assert (3, 3)==snapshot((5, 3, 3)) 265s assert (3, 3)==snapshot((5, 3, 3)) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3, 3)==snapshot((5, 3, 3)) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert (3, 3)==snapshot((5, 3, 3)) 265s {'fix'}: 265s assert (3, 3)==snapshot((5, 3, 3)) 265s assert (3, 3)==snapshot((3, 3)) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3, 3)==snapshot((5, 3, 3)) 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_101.py", line 9, in 265s assert (3, 3)==snapshot((5, 3, 3)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_102.py", line 9, in 265s assert (3, 3)==snapshot((5, 3, 3)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____________________ test_generic [(5, 5) -> (8,) ] ______________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_104.py:9: in 265s assert (8,)==snapshot((5, 5)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_104.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (8,)==snapshot((5, 5)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____________________ test_generic [(5,) -> (8, 8) ] ______________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_105.py:9: in 265s assert (8, 8)==snapshot((5,)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_105.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (8, 8)==snapshot((5,)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [(5, 2+2) -> (8, 4) ] ________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_106.py:9: in 265s assert (8, 4)==snapshot((5, 2+2)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_106.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (8, 4)==snapshot((5, 2+2)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________________ test_generic [(5, 3) -> (8, 3) ] _____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_107.py:9: in 265s assert (8, 3)==snapshot((5, 3)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_107.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (8, 3)==snapshot((5, 3)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____________________ test_generic [(5,) -> (8, 8) ] ______________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_108.py:9: in 265s assert (8, 8)==snapshot((5,)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_108.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (8, 8)==snapshot((5,)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____________________ test_generic [() -> (8, 8, 8) ] _____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_109.py:9: in 265s assert (8, 8, 8)==snapshot(()) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_109.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (8, 8, 8)==snapshot(()) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [(2+2,) -> (8, 8, 4) ] _______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_110.py:9: in 265s assert (8, 8, 4)==snapshot((2+2,)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_110.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (8, 8, 4)==snapshot((2+2,)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________________ test_generic [(3,) -> (8, 8, 3) ] ____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_111.py:9: in 265s assert (8, 8, 3)==snapshot((3,)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_111.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (8, 8, 3)==snapshot((3,)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [(2+2, 5) -> (8, 4) ] ________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_112.py:9: in 265s assert (8, 4)==snapshot((2+2, 5)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_112.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (8, 4)==snapshot((2+2, 5)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [(2+2,) -> (8, 4, 8) ] _______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_113.py:9: in 265s assert (8, 4, 8)==snapshot((2+2,)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_113.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (8, 4, 8)==snapshot((2+2,)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____________ test_generic [(2+2, 2+2) -> (8, 4, 4) ] _____________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_114.py:9: in 265s assert (8, 4, 4)==snapshot((2+2, 2+2)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_114.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (8, 4, 4)==snapshot((2+2, 2+2)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [(2+2, 3) -> (8, 4, 3) ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_115.py:9: in 265s assert (8, 4, 3)==snapshot((2+2, 3)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_115.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (8, 4, 3)==snapshot((2+2, 3)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________________ test_generic [(3, 5) -> (8, 3) ] _____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_116.py:9: in 265s assert (8, 3)==snapshot((3, 5)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_116.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (8, 3)==snapshot((3, 5)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________________ test_generic [(3,) -> (8, 3, 8) ] ____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_117.py:9: in 265s assert (8, 3, 8)==snapshot((3,)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_117.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (8, 3, 8)==snapshot((3,)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [(3, 2+2) -> (8, 3, 4) ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_118.py:9: in 265s assert (8, 3, 4)==snapshot((3, 2+2)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_118.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (8, 3, 4)==snapshot((3, 2+2)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ___________________ test_generic [(3, 3) -> (8, 3, 3) ] ___________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_119.py:9: in 265s assert (8, 3, 3)==snapshot((3, 3)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_119.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (8, 3, 3)==snapshot((3, 3)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [(2+2, 5, 5) -> (4,) ] _______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_120.py:9: in 265s assert (4,)==snapshot((2+2, 5, 5)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_120.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (4,)==snapshot((2+2, 5, 5)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [(2+2, 5) -> (4, 8) ] ________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_121.py:9: in 265s assert (4, 8)==snapshot((2+2, 5)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_121.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (4, 8)==snapshot((2+2, 5)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____________ test_generic [(2+2, 5, 2+2) -> (4, 4) ] _____________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_122.py:9: in 265s assert (4, 4)==snapshot((2+2, 5, 2+2)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_122.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (4, 4)==snapshot((2+2, 5, 2+2)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [(2+2, 5, 3) -> (4, 3) ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_123.py:9: in 265s assert (4, 3)==snapshot((2+2, 5, 3)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_123.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (4, 3)==snapshot((2+2, 5, 3)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [(2+2, 5) -> (4, 8) ] ________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_124.py:9: in 265s assert (4, 8)==snapshot((2+2, 5)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_124.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (4, 8)==snapshot((2+2, 5)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [(2+2,) -> (4, 8, 8) ] _______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_125.py:9: in 265s assert (4, 8, 8)==snapshot((2+2,)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_125.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (4, 8, 8)==snapshot((2+2,)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____________ test_generic [(2+2, 2+2) -> (4, 8, 4) ] _____________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_126.py:9: in 265s assert (4, 8, 4)==snapshot((2+2, 2+2)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_126.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (4, 8, 4)==snapshot((2+2, 2+2)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [(2+2, 3) -> (4, 8, 3) ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_127.py:9: in 265s assert (4, 8, 3)==snapshot((2+2, 3)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_127.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (4, 8, 3)==snapshot((2+2, 3)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____________ test_generic [(2+2, 2+2, 5) -> (4, 4) ] _____________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_128.py:9: in 265s assert (4, 4)==snapshot((2+2, 2+2, 5)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_128.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (4, 4)==snapshot((2+2, 2+2, 5)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____________ test_generic [(2+2, 2+2) -> (4, 4, 8) ] _____________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_129.py:9: in 265s assert (4, 4, 8)==snapshot((2+2, 2+2)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_129.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (4, 4, 8)==snapshot((2+2, 2+2)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____________ test_generic [(2+2, 2+2, 2+2) -> (4, 4, 4) ] _____________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_130.py:9: in 265s assert (4, 4, 4)==snapshot((2+2, 2+2, 2+2)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_130.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (4, 4, 4)==snapshot((2+2, 2+2, 2+2)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [(2+2, 2+2, 3) -> (4, 4, 3) ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_131.py:9: in 265s assert (4, 4, 3)==snapshot((2+2, 2+2, 3)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_131.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (4, 4, 3)==snapshot((2+2, 2+2, 3)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [(2+2, 3, 5) -> (4, 3) ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_132.py:9: in 265s assert (4, 3)==snapshot((2+2, 3, 5)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_132.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (4, 3)==snapshot((2+2, 3, 5)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [(2+2, 3) -> (4, 3, 8) ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_133.py:9: in 265s assert (4, 3, 8)==snapshot((2+2, 3)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_133.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (4, 3, 8)==snapshot((2+2, 3)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [(2+2, 3, 2+2) -> (4, 3, 4) ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_134.py:9: in 265s assert (4, 3, 4)==snapshot((2+2, 3, 2+2)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_134.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (4, 3, 4)==snapshot((2+2, 3, 2+2)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [(2+2, 3, 3) -> (4, 3, 3) ] _______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_135.py:9: in 265s assert (4, 3, 3)==snapshot((2+2, 3, 3)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_135.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (4, 3, 3)==snapshot((2+2, 3, 3)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________________ test_generic [(3, 5, 5) -> (3,) ] ____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s s1 = source(code) 265s print("source:", code) 265s 265s assert set(s1.flags) == flags 265s 265s assert ("fix" in flags) == s1.error 265s 265s for f in all_flags: 265s c3 = build( 265s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 265s ) 265s new_code = f"assert {c2}==snapshot({c3})" 265s 265s print(f"{set(f)}:") 265s print(" ", code) 265s print(" ", new_code) 265s > s2 = s1.run(*f) 265s 265s tests/test_preserve_values.py:245: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:137: in run 265s recorder.fix_all() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 265s file.rewrite() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 265s new_code = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s 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))' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_138.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3,)==snapshot((3, 5, 5)) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert (3,)==snapshot((3, 5, 5)) 265s source: assert (3,)==snapshot((3, 5, 5)) 265s set(): 265s assert (3,)==snapshot((3, 5, 5)) 265s assert (3,)==snapshot((3, 5, 5)) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3,)==snapshot((3, 5, 5)) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert (3,)==snapshot((3, 5, 5)) 265s {'fix'}: 265s assert (3,)==snapshot((3, 5, 5)) 265s assert (3,)==snapshot((3,)) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3,)==snapshot((3, 5, 5)) 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_136.py", line 9, in 265s assert (3,)==snapshot((3, 5, 5)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_137.py", line 9, in 265s assert (3,)==snapshot((3, 5, 5)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________________ test_generic [(3, 5) -> (3, 8) ] _____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_139.py:9: in 265s assert (3, 8)==snapshot((3, 5)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_139.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3, 8)==snapshot((3, 5)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [(3, 5, 2+2) -> (3, 4) ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_140.py:9: in 265s assert (3, 4)==snapshot((3, 5, 2+2)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_140.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3, 4)==snapshot((3, 5, 2+2)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ___________________ test_generic [(3, 5, 3) -> (3, 3) ] ___________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s s1 = source(code) 265s print("source:", code) 265s 265s assert set(s1.flags) == flags 265s 265s assert ("fix" in flags) == s1.error 265s 265s for f in all_flags: 265s c3 = build( 265s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 265s ) 265s new_code = f"assert {c2}==snapshot({c3})" 265s 265s print(f"{set(f)}:") 265s print(" ", code) 265s print(" ", new_code) 265s > s2 = s1.run(*f) 265s 265s tests/test_preserve_values.py:245: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:137: in run 265s recorder.fix_all() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 265s file.rewrite() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 265s new_code = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s 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))' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_143.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3, 3)==snapshot((3, 5, 3)) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert (3, 3)==snapshot((3, 5, 3)) 265s source: assert (3, 3)==snapshot((3, 5, 3)) 265s set(): 265s assert (3, 3)==snapshot((3, 5, 3)) 265s assert (3, 3)==snapshot((3, 5, 3)) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3, 3)==snapshot((3, 5, 3)) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert (3, 3)==snapshot((3, 5, 3)) 265s {'fix'}: 265s assert (3, 3)==snapshot((3, 5, 3)) 265s assert (3, 3)==snapshot((3, 3)) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3, 3)==snapshot((3, 5, 3)) 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_141.py", line 9, in 265s assert (3, 3)==snapshot((3, 5, 3)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_142.py", line 9, in 265s assert (3, 3)==snapshot((3, 5, 3)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________________ test_generic [(3, 5) -> (3, 8) ] _____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_144.py:9: in 265s assert (3, 8)==snapshot((3, 5)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_144.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3, 8)==snapshot((3, 5)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____________________ test_generic [(3,) -> (3, 8, 8) ] ____________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_145.py:9: in 265s assert (3, 8, 8)==snapshot((3,)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_145.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3, 8, 8)==snapshot((3,)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [(3, 2+2) -> (3, 8, 4) ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_146.py:9: in 265s assert (3, 8, 4)==snapshot((3, 2+2)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_146.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3, 8, 4)==snapshot((3, 2+2)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ___________________ test_generic [(3, 3) -> (3, 8, 3) ] ___________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_147.py:9: in 265s assert (3, 8, 3)==snapshot((3, 3)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_147.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3, 8, 3)==snapshot((3, 3)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [(3, 2+2, 5) -> (3, 4) ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_148.py:9: in 265s assert (3, 4)==snapshot((3, 2+2, 5)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_148.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3, 4)==snapshot((3, 2+2, 5)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [(3, 2+2) -> (3, 4, 8) ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_149.py:9: in 265s assert (3, 4, 8)==snapshot((3, 2+2)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_149.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3, 4, 8)==snapshot((3, 2+2)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [(3, 2+2, 2+2) -> (3, 4, 4) ] ______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_150.py:9: in 265s assert (3, 4, 4)==snapshot((3, 2+2, 2+2)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_150.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3, 4, 4)==snapshot((3, 2+2, 2+2)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [(3, 2+2, 3) -> (3, 4, 3) ] _______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_151.py:9: in 265s assert (3, 4, 3)==snapshot((3, 2+2, 3)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_151.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3, 4, 3)==snapshot((3, 2+2, 3)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ___________________ test_generic [(3, 3, 5) -> (3, 3) ] ___________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s s1 = source(code) 265s print("source:", code) 265s 265s assert set(s1.flags) == flags 265s 265s assert ("fix" in flags) == s1.error 265s 265s for f in all_flags: 265s c3 = build( 265s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 265s ) 265s new_code = f"assert {c2}==snapshot({c3})" 265s 265s print(f"{set(f)}:") 265s print(" ", code) 265s print(" ", new_code) 265s > s2 = s1.run(*f) 265s 265s tests/test_preserve_values.py:245: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:137: in run 265s recorder.fix_all() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 265s file.rewrite() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 265s new_code = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s 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))' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_154.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3, 3)==snapshot((3, 3, 5)) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert (3, 3)==snapshot((3, 3, 5)) 265s source: assert (3, 3)==snapshot((3, 3, 5)) 265s set(): 265s assert (3, 3)==snapshot((3, 3, 5)) 265s assert (3, 3)==snapshot((3, 3, 5)) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3, 3)==snapshot((3, 3, 5)) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert (3, 3)==snapshot((3, 3, 5)) 265s {'fix'}: 265s assert (3, 3)==snapshot((3, 3, 5)) 265s assert (3, 3)==snapshot((3, 3)) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3, 3)==snapshot((3, 3, 5)) 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_152.py", line 9, in 265s assert (3, 3)==snapshot((3, 3, 5)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_153.py", line 9, in 265s assert (3, 3)==snapshot((3, 3, 5)) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s ------------------------------ Captured log call ------------------------------- 265s 265s ___________________ test_generic [(3, 3) -> (3, 3, 8) ] ___________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_155.py:9: in 265s assert (3, 3, 8)==snapshot((3, 3)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 265s new_code = self.context.file._value_to_code(new_value_element) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '8 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_155.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3, 3, 8)==snapshot((3, 3)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _______________ test_generic [(3, 3, 2+2) -> (3, 3, 4) ] _______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_156.py:9: in 265s assert (3, 3, 4)==snapshot((3, 3, 2+2)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 265s v = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_156.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert (3, 3, 4)==snapshot((3, 3, 2+2)) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ________________ test_generic [{0: 5, 1: 5, 2: 5} -> {} ] _________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s s1 = source(code) 265s print("source:", code) 265s 265s assert set(s1.flags) == flags 265s 265s assert ("fix" in flags) == s1.error 265s 265s for f in all_flags: 265s c3 = build( 265s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 265s ) 265s new_code = f"assert {c2}==snapshot({c3})" 265s 265s print(f"{set(f)}:") 265s print(" ", code) 265s print(" ", new_code) 265s > s2 = s1.run(*f) 265s 265s tests/test_preserve_values.py:245: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:137: in run 265s recorder.fix_all() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 265s file.rewrite() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 265s new_code = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s 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})' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_161.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {}==snapshot({0: 5, 1: 5, 2: 5}) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert {}==snapshot({0: 5, 1: 5, 2: 5}) 265s source: assert {}==snapshot({0: 5, 1: 5, 2: 5}) 265s set(): 265s assert {}==snapshot({0: 5, 1: 5, 2: 5}) 265s assert {}==snapshot({0: 5, 1: 5, 2: 5}) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {}==snapshot({0: 5, 1: 5, 2: 5}) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert {}==snapshot({0: 5, 1: 5, 2: 5}) 265s {'fix'}: 265s assert {}==snapshot({0: 5, 1: 5, 2: 5}) 265s assert {}==snapshot({}) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {}==snapshot({0: 5, 1: 5, 2: 5}) 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_159.py", line 9, in 265s assert {}==snapshot({0: 5, 1: 5, 2: 5}) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_160.py", line 9, in 265s assert {}==snapshot({0: 5, 1: 5, 2: 5}) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s ------------------------------ Captured log call ------------------------------- 265s 265s _________________ test_generic [{0: 5, 1: 5} -> {2: 8} ] __________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_162.py:9: in 265s assert {2: 8}==snapshot({0: 5, 1: 5}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 265s self.context.file._value_to_code(k), 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '2 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_162.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {2: 8}==snapshot({0: 5, 1: 5}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _________ test_generic [{0: 5, 1: 5, 2: 2+2} -> {2: 4} ] __________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_163.py:9: in 265s assert {2: 4}==snapshot({0: 5, 1: 5, 2: 2+2}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_163.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {2: 4}==snapshot({0: 5, 1: 5, 2: 2+2}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [{0: 5, 1: 5, 2: 3} -> {2: 3} ] _______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s s1 = source(code) 265s print("source:", code) 265s 265s assert set(s1.flags) == flags 265s 265s assert ("fix" in flags) == s1.error 265s 265s for f in all_flags: 265s c3 = build( 265s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 265s ) 265s new_code = f"assert {c2}==snapshot({c3})" 265s 265s print(f"{set(f)}:") 265s print(" ", code) 265s print(" ", new_code) 265s > s2 = s1.run(*f) 265s 265s tests/test_preserve_values.py:245: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:137: in run 265s recorder.fix_all() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 265s file.rewrite() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 265s new_code = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s 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})' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_166.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 265s source: assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 265s set(): 265s assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 265s assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 265s {'fix'}: 265s assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 265s assert {2: 3}==snapshot({2: 3}) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_164.py", line 9, in 265s assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_165.py", line 9, in 265s assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s ------------------------------ Captured log call ------------------------------- 265s 265s _________________ test_generic [{0: 5, 2: 5} -> {1: 8} ] __________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_167.py:9: in 265s assert {1: 8}==snapshot({0: 5, 2: 5}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 265s self.context.file._value_to_code(k), 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '1 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_167.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {1: 8}==snapshot({0: 5, 2: 5}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _________________ test_generic [{0: 5} -> {1: 8, 2: 8} ] __________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_168.py:9: in 265s assert {1: 8, 2: 8}==snapshot({0: 5}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 265s self.context.file._value_to_code(k), 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '1 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_168.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {1: 8, 2: 8}==snapshot({0: 5}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _________ test_generic [{0: 5, 2: 2+2} -> {1: 8, 2: 4} ] __________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_169.py:9: in 265s assert {1: 8, 2: 4}==snapshot({0: 5, 2: 2+2}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_169.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {1: 8, 2: 4}==snapshot({0: 5, 2: 2+2}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [{0: 5, 2: 3} -> {1: 8, 2: 3} ] _______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_170.py:9: in 265s assert {1: 8, 2: 3}==snapshot({0: 5, 2: 3}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 265s self.context.file._value_to_code(k), 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '1 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_170.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {1: 8, 2: 3}==snapshot({0: 5, 2: 3}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _________ test_generic [{0: 5, 1: 2+2, 2: 5} -> {1: 4} ] __________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_171.py:9: in 265s assert {1: 4}==snapshot({0: 5, 1: 2+2, 2: 5}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_171.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {1: 4}==snapshot({0: 5, 1: 2+2, 2: 5}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _________ test_generic [{0: 5, 1: 2+2} -> {1: 4, 2: 8} ] __________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_172.py:9: in 265s assert {1: 4, 2: 8}==snapshot({0: 5, 1: 2+2}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_172.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {1: 4, 2: 8}==snapshot({0: 5, 1: 2+2}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____ test_generic [{0: 5, 1: 2+2, 2: 2+2} -> {1: 4, 2: 4} ] ______ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_173.py:9: in 265s assert {1: 4, 2: 4}==snapshot({0: 5, 1: 2+2, 2: 2+2}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_173.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {1: 4, 2: 4}==snapshot({0: 5, 1: 2+2, 2: 2+2}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______ test_generic [{0: 5, 1: 2+2, 2: 3} -> {1: 4, 2: 3} ] _______ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_174.py:9: in 265s assert {1: 4, 2: 3}==snapshot({0: 5, 1: 2+2, 2: 3}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_174.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {1: 4, 2: 3}==snapshot({0: 5, 1: 2+2, 2: 3}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [{0: 5, 1: 3, 2: 5} -> {1: 3} ] _______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s s1 = source(code) 265s print("source:", code) 265s 265s assert set(s1.flags) == flags 265s 265s assert ("fix" in flags) == s1.error 265s 265s for f in all_flags: 265s c3 = build( 265s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 265s ) 265s new_code = f"assert {c2}==snapshot({c3})" 265s 265s print(f"{set(f)}:") 265s print(" ", code) 265s print(" ", new_code) 265s > s2 = s1.run(*f) 265s 265s tests/test_preserve_values.py:245: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:137: in run 265s recorder.fix_all() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 265s file.rewrite() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 265s new_code = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s 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})' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_177.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 265s source: assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 265s set(): 265s assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 265s assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 265s {'fix'}: 265s assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 265s assert {1: 3}==snapshot({1: 3}) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_175.py", line 9, in 265s assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_176.py", line 9, in 265s assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [{0: 5, 1: 3} -> {1: 3, 2: 8} ] _______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_178.py:9: in 265s assert {1: 3, 2: 8}==snapshot({0: 5, 1: 3}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 265s self.context.file._value_to_code(k), 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '2 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_178.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {1: 3, 2: 8}==snapshot({0: 5, 1: 3}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______ test_generic [{0: 5, 1: 3, 2: 2+2} -> {1: 3, 2: 4} ] _______ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_179.py:9: in 265s assert {1: 3, 2: 4}==snapshot({0: 5, 1: 3, 2: 2+2}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_179.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {1: 3, 2: 4}==snapshot({0: 5, 1: 3, 2: 2+2}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ___________ test_generic [{0: 5, 1: 3, 2: 3} -> {1: 3, 2: 3} ] ____________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s s1 = source(code) 265s print("source:", code) 265s 265s assert set(s1.flags) == flags 265s 265s assert ("fix" in flags) == s1.error 265s 265s for f in all_flags: 265s c3 = build( 265s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 265s ) 265s new_code = f"assert {c2}==snapshot({c3})" 265s 265s print(f"{set(f)}:") 265s print(" ", code) 265s print(" ", new_code) 265s > s2 = s1.run(*f) 265s 265s tests/test_preserve_values.py:245: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:137: in run 265s recorder.fix_all() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 265s file.rewrite() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 265s new_code = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s 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})' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_182.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 265s source: assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 265s set(): 265s assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 265s assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 265s {'fix'}: 265s assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 265s assert {1: 3, 2: 3}==snapshot({1: 3, 2: 3}) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_180.py", line 9, in 265s assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_181.py", line 9, in 265s assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s ------------------------------ Captured log call ------------------------------- 265s 265s _________________ test_generic [{1: 5, 2: 5} -> {0: 8} ] __________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_183.py:9: in 265s assert {0: 8}==snapshot({1: 5, 2: 5}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 265s self.context.file._value_to_code(k), 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '0 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_183.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 8}==snapshot({1: 5, 2: 5}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _________________ test_generic [{1: 5} -> {0: 8, 2: 8} ] __________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_184.py:9: in 265s assert {0: 8, 2: 8}==snapshot({1: 5}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 265s self.context.file._value_to_code(k), 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '0 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_184.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 8, 2: 8}==snapshot({1: 5}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _________ test_generic [{1: 5, 2: 2+2} -> {0: 8, 2: 4} ] __________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_185.py:9: in 265s assert {0: 8, 2: 4}==snapshot({1: 5, 2: 2+2}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_185.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 8, 2: 4}==snapshot({1: 5, 2: 2+2}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [{1: 5, 2: 3} -> {0: 8, 2: 3} ] _______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_186.py:9: in 265s assert {0: 8, 2: 3}==snapshot({1: 5, 2: 3}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 265s self.context.file._value_to_code(k), 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '0 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_186.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 8, 2: 3}==snapshot({1: 5, 2: 3}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _________________ test_generic [{2: 5} -> {0: 8, 1: 8} ] __________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_187.py:9: in 265s assert {0: 8, 1: 8}==snapshot({2: 5}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 265s self.context.file._value_to_code(k), 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '0 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_187.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 8, 1: 8}==snapshot({2: 5}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ________________ test_generic [{} -> {0: 8, 1: 8, 2: 8} ] _________________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_188.py:9: in 265s assert {0: 8, 1: 8, 2: 8}==snapshot({}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 265s self.context.file._value_to_code(k), 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '0 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_188.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 8, 1: 8, 2: 8}==snapshot({}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _________ test_generic [{2: 2+2} -> {0: 8, 1: 8, 2: 4} ] __________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_189.py:9: in 265s assert {0: 8, 1: 8, 2: 4}==snapshot({2: 2+2}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_189.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 8, 1: 8, 2: 4}==snapshot({2: 2+2}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [{2: 3} -> {0: 8, 1: 8, 2: 3} ] _______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_190.py:9: in 265s assert {0: 8, 1: 8, 2: 3}==snapshot({2: 3}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 265s self.context.file._value_to_code(k), 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '0 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_190.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 8, 1: 8, 2: 3}==snapshot({2: 3}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _________ test_generic [{1: 2+2, 2: 5} -> {0: 8, 1: 4} ] __________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_191.py:9: in 265s assert {0: 8, 1: 4}==snapshot({1: 2+2, 2: 5}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_191.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 8, 1: 4}==snapshot({1: 2+2, 2: 5}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _________ test_generic [{1: 2+2} -> {0: 8, 1: 4, 2: 8} ] __________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_192.py:9: in 265s assert {0: 8, 1: 4, 2: 8}==snapshot({1: 2+2}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_192.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 8, 1: 4, 2: 8}==snapshot({1: 2+2}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____ test_generic [{1: 2+2, 2: 2+2} -> {0: 8, 1: 4, 2: 4} ] ______ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_193.py:9: in 265s assert {0: 8, 1: 4, 2: 4}==snapshot({1: 2+2, 2: 2+2}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_193.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 8, 1: 4, 2: 4}==snapshot({1: 2+2, 2: 2+2}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______ test_generic [{1: 2+2, 2: 3} -> {0: 8, 1: 4, 2: 3} ] _______ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_194.py:9: in 265s assert {0: 8, 1: 4, 2: 3}==snapshot({1: 2+2, 2: 3}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_194.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 8, 1: 4, 2: 3}==snapshot({1: 2+2, 2: 3}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [{1: 3, 2: 5} -> {0: 8, 1: 3} ] _______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_195.py:9: in 265s assert {0: 8, 1: 3}==snapshot({1: 3, 2: 5}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 265s self.context.file._value_to_code(k), 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '0 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_195.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 8, 1: 3}==snapshot({1: 3, 2: 5}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [{1: 3} -> {0: 8, 1: 3, 2: 8} ] _______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_196.py:9: in 265s assert {0: 8, 1: 3, 2: 8}==snapshot({1: 3}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 265s self.context.file._value_to_code(k), 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '0 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_196.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 8, 1: 3, 2: 8}==snapshot({1: 3}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______ test_generic [{1: 3, 2: 2+2} -> {0: 8, 1: 3, 2: 4} ] _______ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_197.py:9: in 265s assert {0: 8, 1: 3, 2: 4}==snapshot({1: 3, 2: 2+2}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 265s self.context.file._value_to_code(k), 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '0 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_197.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 8, 1: 3, 2: 4}==snapshot({1: 3, 2: 2+2}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ___________ test_generic [{1: 3, 2: 3} -> {0: 8, 1: 3, 2: 3} ] ____________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_198.py:9: in 265s assert {0: 8, 1: 3, 2: 3}==snapshot({1: 3, 2: 3}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 265s self.context.file._value_to_code(k), 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '0 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_198.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 8, 1: 3, 2: 3}==snapshot({1: 3, 2: 3}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _________ test_generic [{0: 2+2, 1: 5, 2: 5} -> {0: 4} ] __________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_199.py:9: in 265s assert {0: 4}==snapshot({0: 2+2, 1: 5, 2: 5}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_199.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 4}==snapshot({0: 2+2, 1: 5, 2: 5}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _________ test_generic [{0: 2+2, 1: 5} -> {0: 4, 2: 8} ] __________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_200.py:9: in 265s assert {0: 4, 2: 8}==snapshot({0: 2+2, 1: 5}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_200.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 4, 2: 8}==snapshot({0: 2+2, 1: 5}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____ test_generic [{0: 2+2, 1: 5, 2: 2+2} -> {0: 4, 2: 4} ] ______ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_201.py:9: in 265s assert {0: 4, 2: 4}==snapshot({0: 2+2, 1: 5, 2: 2+2}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_201.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 4, 2: 4}==snapshot({0: 2+2, 1: 5, 2: 2+2}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______ test_generic [{0: 2+2, 1: 5, 2: 3} -> {0: 4, 2: 3} ] _______ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_202.py:9: in 265s assert {0: 4, 2: 3}==snapshot({0: 2+2, 1: 5, 2: 3}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_202.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 4, 2: 3}==snapshot({0: 2+2, 1: 5, 2: 3}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _________ test_generic [{0: 2+2, 2: 5} -> {0: 4, 1: 8} ] __________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_203.py:9: in 265s assert {0: 4, 1: 8}==snapshot({0: 2+2, 2: 5}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_203.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 4, 1: 8}==snapshot({0: 2+2, 2: 5}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _________ test_generic [{0: 2+2} -> {0: 4, 1: 8, 2: 8} ] __________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_204.py:9: in 265s assert {0: 4, 1: 8, 2: 8}==snapshot({0: 2+2}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_204.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 4, 1: 8, 2: 8}==snapshot({0: 2+2}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____ test_generic [{0: 2+2, 2: 2+2} -> {0: 4, 1: 8, 2: 4} ] ______ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_205.py:9: in 265s assert {0: 4, 1: 8, 2: 4}==snapshot({0: 2+2, 2: 2+2}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_205.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 4, 1: 8, 2: 4}==snapshot({0: 2+2, 2: 2+2}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______ test_generic [{0: 2+2, 2: 3} -> {0: 4, 1: 8, 2: 3} ] _______ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_206.py:9: in 265s assert {0: 4, 1: 8, 2: 3}==snapshot({0: 2+2, 2: 3}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_206.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 4, 1: 8, 2: 3}==snapshot({0: 2+2, 2: 3}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____ test_generic [{0: 2+2, 1: 2+2, 2: 5} -> {0: 4, 1: 4} ] ______ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_207.py:9: in 265s assert {0: 4, 1: 4}==snapshot({0: 2+2, 1: 2+2, 2: 5}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_207.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 4, 1: 4}==snapshot({0: 2+2, 1: 2+2, 2: 5}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____ test_generic [{0: 2+2, 1: 2+2} -> {0: 4, 1: 4, 2: 8} ] ______ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_208.py:9: in 265s assert {0: 4, 1: 4, 2: 8}==snapshot({0: 2+2, 1: 2+2}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_208.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 4, 1: 4, 2: 8}==snapshot({0: 2+2, 1: 2+2}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ____ test_generic [{0: 2+2, 1: 2+2, 2: 2+2} -> {0: 4, 1: 4, 2: 4} ] ____ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_209.py:9: in 265s assert {0: 4, 1: 4, 2: 4}==snapshot({0: 2+2, 1: 2+2, 2: 2+2}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_209.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 4, 1: 4, 2: 4}==snapshot({0: 2+2, 1: 2+2, 2: 2+2}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____ test_generic [{0: 2+2, 1: 2+2, 2: 3} -> {0: 4, 1: 4, 2: 3} ] _____ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_210.py:9: in 265s assert {0: 4, 1: 4, 2: 3}==snapshot({0: 2+2, 1: 2+2, 2: 3}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_210.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 4, 1: 4, 2: 3}==snapshot({0: 2+2, 1: 2+2, 2: 3}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______ test_generic [{0: 2+2, 1: 3, 2: 5} -> {0: 4, 1: 3} ] _______ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_211.py:9: in 265s assert {0: 4, 1: 3}==snapshot({0: 2+2, 1: 3, 2: 5}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_211.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 4, 1: 3}==snapshot({0: 2+2, 1: 3, 2: 5}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______ test_generic [{0: 2+2, 1: 3} -> {0: 4, 1: 3, 2: 8} ] _______ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_212.py:9: in 265s assert {0: 4, 1: 3, 2: 8}==snapshot({0: 2+2, 1: 3}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_212.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 4, 1: 3, 2: 8}==snapshot({0: 2+2, 1: 3}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____ test_generic [{0: 2+2, 1: 3, 2: 2+2} -> {0: 4, 1: 3, 2: 4} ] _____ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_213.py:9: in 265s assert {0: 4, 1: 3, 2: 4}==snapshot({0: 2+2, 1: 3, 2: 2+2}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_213.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 4, 1: 3, 2: 4}==snapshot({0: 2+2, 1: 3, 2: 2+2}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______ test_generic [{0: 2+2, 1: 3, 2: 3} -> {0: 4, 1: 3, 2: 3} ] ______ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_214.py:9: in 265s assert {0: 4, 1: 3, 2: 3}==snapshot({0: 2+2, 1: 3, 2: 3}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_214.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 4, 1: 3, 2: 3}==snapshot({0: 2+2, 1: 3, 2: 3}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [{0: 3, 1: 5, 2: 5} -> {0: 3} ] _______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s s1 = source(code) 265s print("source:", code) 265s 265s assert set(s1.flags) == flags 265s 265s assert ("fix" in flags) == s1.error 265s 265s for f in all_flags: 265s c3 = build( 265s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 265s ) 265s new_code = f"assert {c2}==snapshot({c3})" 265s 265s print(f"{set(f)}:") 265s print(" ", code) 265s print(" ", new_code) 265s > s2 = s1.run(*f) 265s 265s tests/test_preserve_values.py:245: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:137: in run 265s recorder.fix_all() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 265s file.rewrite() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 265s new_code = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s 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})' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_217.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 265s source: assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 265s set(): 265s assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 265s assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 265s {'fix'}: 265s assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 265s assert {0: 3}==snapshot({0: 3}) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_215.py", line 9, in 265s assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_216.py", line 9, in 265s assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [{0: 3, 1: 5} -> {0: 3, 2: 8} ] _______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_218.py:9: in 265s assert {0: 3, 2: 8}==snapshot({0: 3, 1: 5}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 265s self.context.file._value_to_code(k), 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '2 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_218.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 3, 2: 8}==snapshot({0: 3, 1: 5}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______ test_generic [{0: 3, 1: 5, 2: 2+2} -> {0: 3, 2: 4} ] _______ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_219.py:9: in 265s assert {0: 3, 2: 4}==snapshot({0: 3, 1: 5, 2: 2+2}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_219.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 3, 2: 4}==snapshot({0: 3, 1: 5, 2: 2+2}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ___________ test_generic [{0: 3, 1: 5, 2: 3} -> {0: 3, 2: 3} ] ____________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s s1 = source(code) 265s print("source:", code) 265s 265s assert set(s1.flags) == flags 265s 265s assert ("fix" in flags) == s1.error 265s 265s for f in all_flags: 265s c3 = build( 265s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 265s ) 265s new_code = f"assert {c2}==snapshot({c3})" 265s 265s print(f"{set(f)}:") 265s print(" ", code) 265s print(" ", new_code) 265s > s2 = s1.run(*f) 265s 265s tests/test_preserve_values.py:245: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:137: in run 265s recorder.fix_all() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 265s file.rewrite() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 265s new_code = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s 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})' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_222.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 265s source: assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 265s set(): 265s assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 265s assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 265s {'fix'}: 265s assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 265s assert {0: 3, 2: 3}==snapshot({0: 3, 2: 3}) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_220.py", line 9, in 265s assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_221.py", line 9, in 265s assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [{0: 3, 2: 5} -> {0: 3, 1: 8} ] _______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_223.py:9: in 265s assert {0: 3, 1: 8}==snapshot({0: 3, 2: 5}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 265s self.context.file._value_to_code(k), 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '1 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_223.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 3, 1: 8}==snapshot({0: 3, 2: 5}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______________ test_generic [{0: 3} -> {0: 3, 1: 8, 2: 8} ] _______________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_224.py:9: in 265s assert {0: 3, 1: 8, 2: 8}==snapshot({0: 3}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 265s self.context.file._value_to_code(k), 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '1 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_224.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 3, 1: 8, 2: 8}==snapshot({0: 3}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______ test_generic [{0: 3, 2: 2+2} -> {0: 3, 1: 8, 2: 4} ] _______ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_225.py:9: in 265s assert {0: 3, 1: 8, 2: 4}==snapshot({0: 3, 2: 2+2}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_225.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 3, 1: 8, 2: 4}==snapshot({0: 3, 2: 2+2}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ___________ test_generic [{0: 3, 2: 3} -> {0: 3, 1: 8, 2: 3} ] ____________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_226.py:9: in 265s assert {0: 3, 1: 8, 2: 3}==snapshot({0: 3, 2: 3}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 265s self.context.file._value_to_code(k), 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '1 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_226.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 3, 1: 8, 2: 3}==snapshot({0: 3, 2: 3}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______ test_generic [{0: 3, 1: 2+2, 2: 5} -> {0: 3, 1: 4} ] _______ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_227.py:9: in 265s assert {0: 3, 1: 4}==snapshot({0: 3, 1: 2+2, 2: 5}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_227.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 3, 1: 4}==snapshot({0: 3, 1: 2+2, 2: 5}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______ test_generic [{0: 3, 1: 2+2} -> {0: 3, 1: 4, 2: 8} ] _______ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_228.py:9: in 265s assert {0: 3, 1: 4, 2: 8}==snapshot({0: 3, 1: 2+2}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_228.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 3, 1: 4, 2: 8}==snapshot({0: 3, 1: 2+2}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s _____ test_generic [{0: 3, 1: 2+2, 2: 2+2} -> {0: 3, 1: 4, 2: 4} ] _____ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_229.py:9: in 265s assert {0: 3, 1: 4, 2: 4}==snapshot({0: 3, 1: 2+2, 2: 2+2}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_229.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 3, 1: 4, 2: 4}==snapshot({0: 3, 1: 2+2, 2: 2+2}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______ test_generic [{0: 3, 1: 2+2, 2: 3} -> {0: 3, 1: 4, 2: 3} ] ______ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_230.py:9: in 265s assert {0: 3, 1: 4, 2: 3}==snapshot({0: 3, 1: 2+2, 2: 3}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_230.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 3, 1: 4, 2: 3}==snapshot({0: 3, 1: 2+2, 2: 3}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ___________ test_generic [{0: 3, 1: 3, 2: 5} -> {0: 3, 1: 3} ] ____________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s s1 = source(code) 265s print("source:", code) 265s 265s assert set(s1.flags) == flags 265s 265s assert ("fix" in flags) == s1.error 265s 265s for f in all_flags: 265s c3 = build( 265s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 265s ) 265s new_code = f"assert {c2}==snapshot({c3})" 265s 265s print(f"{set(f)}:") 265s print(" ", code) 265s print(" ", new_code) 265s > s2 = s1.run(*f) 265s 265s tests/test_preserve_values.py:245: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:137: in run 265s recorder.fix_all() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 265s file.rewrite() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 265s new_code = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s 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})' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_233.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 265s source: assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 265s set(): 265s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 265s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 265s reported_flags: {'fix'} 265s run: pytest --inline-snapshot= 265s output: 265s |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 265s {'fix'}: 265s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 265s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3}) 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_231.py", line 9, in 265s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s Traceback (most recent call last): 265s File "/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py", line 114, in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_232.py", line 9, in 265s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s AssertionError 265s ------------------------------ Captured log call ------------------------------- 265s 265s ___________ test_generic [{0: 3, 1: 3} -> {0: 3, 1: 3, 2: 8} ] ____________ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_234.py:9: in 265s assert {0: 3, 1: 3, 2: 8}==snapshot({0: 3, 1: 3}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 265s self.context.file._value_to_code(k), 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 265s return self._token_to_code(value_to_token(value)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '2 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_234.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 3, 1: 3, 2: 8}==snapshot({0: 3, 1: 3}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ______ test_generic [{0: 3, 1: 3, 2: 2+2} -> {0: 3, 1: 3, 2: 4} ] ______ 265s 265s source = .w at 0x611fc1bf36a0> 265s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x611fc5dbfe90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 265s 265s def test_generic(source, subtests): 265s for braces in ("[]", "()", "{}"): 265s for value_specs in itertools.product(stuff, repeat=3): 265s flags = set().union(*[e[3] for e in value_specs]) 265s all_flags = { 265s frozenset(x) - {""} 265s for x in itertools.combinations_with_replacement( 265s flags | {""}, len(flags) 265s ) 265s } 265s 265s def build(value_lists): 265s value_lists = list(value_lists) 265s 265s if braces == "{}": 265s values = [ 265s f"{i}: {value_list[0]}" 265s for i, value_list in enumerate(value_lists) 265s if value_list 265s ] 265s else: 265s values = [x for value_list in value_lists for x in value_list] 265s 265s code = ", ".join(values) 265s 265s comma = "" 265s if len(values) == 1 and braces == "()": 265s comma = "," 265s 265s return f"{braces[0]}{code}{comma}{braces[1]}" 265s 265s c1 = build(spec[0] for spec in value_specs) 265s c2 = build(spec[1] for spec in value_specs) 265s code = f"assert {c2}==snapshot({c1})" 265s 265s named_flags = ", ".join(flags) 265s 265s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 265s > s1 = source(code) 265s 265s tests/test_preserve_values.py:229: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_235.py:9: in 265s assert {0: 3, 1: 3, 2: 4}==snapshot({0: 3, 1: 3, 2: 2+2}) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 265s result[key] = yield from self.get_adapter( 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_235.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert {0: 3, 1: 3, 2: 4}==snapshot({0: 3, 1: 3, 2: 2+2}) 265s ------------------------------ Captured log call ------------------------------- 265s 265s ________________________ test_pydantic_create_snapshot _________________________ 265s 265s def test_pydantic_create_snapshot(): 265s 265s Example( 265s """ 265s from pydantic import BaseModel 265s from inline_snapshot import snapshot 265s 265s class M(BaseModel): 265s size:int 265s name:str 265s age:int=4 265s 265s def test_pydantic(): 265s m=M(size=5,name="Tom") 265s assert m==snapshot() 265s assert m.dict()==snapshot() 265s 265s """ 265s > ).run_pytest( 265s ["--inline-snapshot=create"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s 265s from pydantic import BaseModel 265s from inline_snapshot import snapshot 265s 265s class M(BaseModel): 265s size:int 265s name:str 265s age:int=4 265s 265s def test_pydantic(): 265s m=M(size=5,name="Tom") 265s assert m==snapshot(M(size=5, name="Tom")) 265s assert m.dict()==snapshot({"size": 5, "name": "Tom", "age": 4}) 265s 265s \ 265s """ 265s } 265s ), 265s ).run_pytest( 265s ["--inline-snapshot=disable"] 265s ) 265s 265s tests/test_pydantic.py:23: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = ['--inline-snapshot=create'] 265s 265s def run_pytest( 265s self, 265s args: list[str] = [], 265s *, 265s term_columns=80, 265s env: dict[str, str] = {}, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s stderr: Snapshot[str] | None = None, 265s returncode: Snapshot[int] | None = None, 265s ) -> Example: 265s """Run pytest with the given args and env variables in an seperate 265s process. 265s 265s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 265s 265s Parameters: 265s args: pytest arguments like "--inline-snapshot=fix" 265s env: dict of environment variables 265s changed_files: snapshot of files which are changed by this run. 265s report: snapshot of the report at the end of the pytest run. 265s stderr: pytest stderr output 265s returncode: snapshot of the pytest returncode. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s self._write_files(tmp_path) 265s 265s cmd = [sys.executable, "-m", "pytest", *args] 265s 265s command_env = dict(os.environ) 265s command_env["TERM"] = "unknown" 265s command_env["COLUMNS"] = str( 265s term_columns + 1 if platform.system() == "Windows" else term_columns 265s ) 265s command_env.pop("CI", None) 265s 265s command_env.update(env) 265s 265s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 265s 265s print("run>", *cmd) 265s print("stdout:") 265s print(result.stdout.decode()) 265s print("stderr:") 265s print(result.stderr.decode()) 265s 265s if returncode is not None: 265s assert result.returncode == returncode 265s 265s if stderr is not None: 265s assert result.stderr.decode() == stderr 265s 265s if report is not None: 265s 265s report_list = [] 265s record = False 265s for line in result.stdout.decode().splitlines(): 265s line = line.strip() 265s if line.startswith("===="): 265s record = False 265s 265s if record and line: 265s report_list.append(line) 265s 265s if line.startswith("====") and "inline snapshot" in line: 265s record = True 265s 265s report_str = "\n".join(report_list) 265s 265s assert normalize(report_str) == report, repr(report_str) 265s 265s if changed_files is not None: 265s current_files = {} 265s 265s for name, content in sorted(self._read_files(tmp_path).items()): 265s if name not in self.files or self.files[name] != content: 265s current_files[name] = content 265s > assert changed_files == current_files 265s E AssertionError: assert {'test_someth... 4})\n\n '} == {} 265s E 265s E Left contains 1 more item: 265s E {'test_something.py': '\n' 265s E 'from pydantic import BaseModel\n' 265s E 'from inline_snapshot import snapshot\n' 265s E '\n' 265s E 'class M(BaseModel):\n'... 265s E 265s E ...Full output truncated (12 lines hidden), use '-vv' to show 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s 265s from pydantic import BaseModel 265s from inline_snapshot import snapshot 265s 265s class M(BaseModel): 265s size:int 265s name:str 265s age:int=4 265s 265s def test_pydantic(): 265s m=M(size=5,name="Tom") 265s assert m==snapshot() 265s assert m.dict()==snapshot() 265s 265s 265s 265s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmp7wxbbk8e 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_something.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ________________________________ test_pydantic _________________________________ 265s 265s def test_pydantic(): 265s m=M(size=5,name="Tom") 265s > assert m==snapshot() 265s 265s test_something.py:12: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '', filename = PosixPath('/tmp/tmp7wxbbk8e/test_something.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_something.py::test_pydantic - TypeError: CliRunner.__init__() got... 265s ============================== 1 failed in 0.31s =============================== 265s 265s stderr: 265s 265s ___________________________ test_pydantic_field_repr ___________________________ 265s 265s def test_pydantic_field_repr(): 265s 265s Example( 265s """\ 265s from inline_snapshot import snapshot 265s from pydantic import BaseModel,Field 265s 265s class container(BaseModel): 265s a: int 265s b: int = Field(default=5,repr=False) 265s 265s assert container(a=1,b=5) == snapshot() 265s """ 265s > ).run_pytest( 265s ["--inline-snapshot=create"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s from inline_snapshot import snapshot 265s from pydantic import BaseModel,Field 265s 265s class container(BaseModel): 265s a: int 265s b: int = Field(default=5,repr=False) 265s 265s assert container(a=1,b=5) == snapshot(container(a=1)) 265s """ 265s } 265s ), 265s ).run_pytest( 265s ["--inline-snapshot=disable"] 265s ) 265s 265s tests/test_pydantic.py:64: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = ['--inline-snapshot=create'] 265s 265s def run_pytest( 265s self, 265s args: list[str] = [], 265s *, 265s term_columns=80, 265s env: dict[str, str] = {}, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s stderr: Snapshot[str] | None = None, 265s returncode: Snapshot[int] | None = None, 265s ) -> Example: 265s """Run pytest with the given args and env variables in an seperate 265s process. 265s 265s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 265s 265s Parameters: 265s args: pytest arguments like "--inline-snapshot=fix" 265s env: dict of environment variables 265s changed_files: snapshot of files which are changed by this run. 265s report: snapshot of the report at the end of the pytest run. 265s stderr: pytest stderr output 265s returncode: snapshot of the pytest returncode. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s self._write_files(tmp_path) 265s 265s cmd = [sys.executable, "-m", "pytest", *args] 265s 265s command_env = dict(os.environ) 265s command_env["TERM"] = "unknown" 265s command_env["COLUMNS"] = str( 265s term_columns + 1 if platform.system() == "Windows" else term_columns 265s ) 265s command_env.pop("CI", None) 265s 265s command_env.update(env) 265s 265s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 265s 265s print("run>", *cmd) 265s print("stdout:") 265s print(result.stdout.decode()) 265s print("stderr:") 265s print(result.stderr.decode()) 265s 265s if returncode is not None: 265s assert result.returncode == returncode 265s 265s if stderr is not None: 265s assert result.stderr.decode() == stderr 265s 265s if report is not None: 265s 265s report_list = [] 265s record = False 265s for line in result.stdout.decode().splitlines(): 265s line = line.strip() 265s if line.startswith("===="): 265s record = False 265s 265s if record and line: 265s report_list.append(line) 265s 265s if line.startswith("====") and "inline snapshot" in line: 265s record = True 265s 265s report_str = "\n".join(report_list) 265s 265s assert normalize(report_str) == report, repr(report_str) 265s 265s if changed_files is not None: 265s current_files = {} 265s 265s for name, content in sorted(self._read_files(tmp_path).items()): 265s if name not in self.files or self.files[name] != content: 265s current_files[name] = content 265s > assert changed_files == current_files 265s E AssertionError: assert {'test_someth...iner(a=1))\n'} == {} 265s E 265s E Left contains 1 more item: 265s E {'test_something.py': 'from inline_snapshot import snapshot\n' 265s E 'from pydantic import BaseModel,Field\n' 265s E '\n' 265s E 'class container(BaseModel):\n' 265s E ' a: int\n'... 265s E 265s E ...Full output truncated (4 lines hidden), use '-vv' to show 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot 265s from pydantic import BaseModel,Field 265s 265s class container(BaseModel): 265s a: int 265s b: int = Field(default=5,repr=False) 265s 265s assert container(a=1,b=5) == snapshot() 265s 265s 265s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmpxjz_kpd_ 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 0 items / 1 error 265s 265s ==================================== ERRORS ==================================== 265s ______________________ ERROR collecting test_something.py ______________________ 265s test_something.py:8: in 265s assert container(a=1,b=5) == snapshot() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 265s runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s ERROR test_something.py - TypeError: CliRunner.__init__() got an unexpected k... 265s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 265s =============================== 1 error in 0.40s =============================== 265s 265s stderr: 265s 265s _________________________ test_pydantic_default_value __________________________ 265s 265s def test_pydantic_default_value(): 265s Example( 265s """\ 265s from inline_snapshot import snapshot,Is 265s from dataclasses import dataclass,field 265s from pydantic import BaseModel,Field 265s 265s class A(BaseModel): 265s a:int 265s b:int=2 265s c:list=Field(default_factory=list) 265s 265s def test_something(): 265s assert A(a=1) == snapshot(A(a=1,b=2,c=[])) 265s """ 265s > ).run_pytest( 265s ["--inline-snapshot=update"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s from inline_snapshot import snapshot,Is 265s from dataclasses import dataclass,field 265s from pydantic import BaseModel,Field 265s 265s class A(BaseModel): 265s a:int 265s b:int=2 265s c:list=Field(default_factory=list) 265s 265s def test_something(): 265s assert A(a=1) == snapshot(A(a=1)) 265s """ 265s } 265s ), 265s ) 265s 265s tests/test_pydantic.py:100: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = ['--inline-snapshot=update'] 265s 265s def run_pytest( 265s self, 265s args: list[str] = [], 265s *, 265s term_columns=80, 265s env: dict[str, str] = {}, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s stderr: Snapshot[str] | None = None, 265s returncode: Snapshot[int] | None = None, 265s ) -> Example: 265s """Run pytest with the given args and env variables in an seperate 265s process. 265s 265s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 265s 265s Parameters: 265s args: pytest arguments like "--inline-snapshot=fix" 265s env: dict of environment variables 265s changed_files: snapshot of files which are changed by this run. 265s report: snapshot of the report at the end of the pytest run. 265s stderr: pytest stderr output 265s returncode: snapshot of the pytest returncode. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s self._write_files(tmp_path) 265s 265s cmd = [sys.executable, "-m", "pytest", *args] 265s 265s command_env = dict(os.environ) 265s command_env["TERM"] = "unknown" 265s command_env["COLUMNS"] = str( 265s term_columns + 1 if platform.system() == "Windows" else term_columns 265s ) 265s command_env.pop("CI", None) 265s 265s command_env.update(env) 265s 265s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 265s 265s print("run>", *cmd) 265s print("stdout:") 265s print(result.stdout.decode()) 265s print("stderr:") 265s print(result.stderr.decode()) 265s 265s if returncode is not None: 265s assert result.returncode == returncode 265s 265s if stderr is not None: 265s assert result.stderr.decode() == stderr 265s 265s if report is not None: 265s 265s report_list = [] 265s record = False 265s for line in result.stdout.decode().splitlines(): 265s line = line.strip() 265s if line.startswith("===="): 265s record = False 265s 265s if record and line: 265s report_list.append(line) 265s 265s if line.startswith("====") and "inline snapshot" in line: 265s record = True 265s 265s report_str = "\n".join(report_list) 265s 265s assert normalize(report_str) == report, repr(report_str) 265s 265s if changed_files is not None: 265s current_files = {} 265s 265s for name, content in sorted(self._read_files(tmp_path).items()): 265s if name not in self.files or self.files[name] != content: 265s current_files[name] = content 265s > assert changed_files == current_files 265s E AssertionError: assert {'test_someth...ot(A(a=1))\n'} == {} 265s E 265s E Left contains 1 more item: 265s E {'test_something.py': 'from inline_snapshot import snapshot,Is\n' 265s E 'from dataclasses import dataclass,field\n' 265s E 'from pydantic import BaseModel,Field\n' 265s E '\n' 265s E 'class A(BaseModel):\n'... 265s E 265s E ...Full output truncated (7 lines hidden), use '-vv' to show 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot,Is 265s from dataclasses import dataclass,field 265s from pydantic import BaseModel,Field 265s 265s class A(BaseModel): 265s a:int 265s b:int=2 265s c:list=Field(default_factory=list) 265s 265s def test_something(): 265s assert A(a=1) == snapshot(A(a=1,b=2,c=[])) 265s 265s 265s run> /usr/bin/python3.12 -m pytest --inline-snapshot=update 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmpdmsd3bt4 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_something.py . [100%] 265s =============================== inline snapshot ================================ 265s ─────────────────────────────── Update snapshots ─────────────────────────────── 265s 265s stderr: 265s Traceback (most recent call last): 265s File "", line 198, in _run_module_as_main 265s File "", line 88, in _run_code 265s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 265s raise SystemExit(pytest.console_main()) 265s ^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 265s code = main() 265s ^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 265s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 265s return wrap_session(config, _main) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 265s config.hook.pytest_sessionfinish( 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 265s teardown.send(result) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 265s self.config.hook.pytest_terminal_summary( 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary 265s diff = file.diff() 265s ^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff 265s unified_diff(self.source.splitlines(), self.new_code().splitlines()), 265s ^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s ^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s _________________________ test_pydantic_factory_method _________________________ 265s 265s def test_pydantic_factory_method(): 265s Example( 265s """\ 265s from inline_snapshot import snapshot 265s from pydantic import BaseModel 265s 265s class A(BaseModel): 265s a:int 265s 265s @classmethod 265s def from_str(cls,s): 265s return cls(a=int(s)) 265s 265s def test_something(): 265s for a in [1,2]: 265s assert A(a=2) == snapshot(A.from_str("1")) 265s """ 265s > ).run_pytest( 265s ["--inline-snapshot=fix"], 265s changed_files=snapshot( 265s { 265s "test_something.py": """\ 265s from inline_snapshot import snapshot 265s from pydantic import BaseModel 265s 265s class A(BaseModel): 265s a:int 265s 265s @classmethod 265s def from_str(cls,s): 265s return cls(a=int(s)) 265s 265s def test_something(): 265s for a in [1,2]: 265s assert A(a=2) == snapshot(A(a=2)) 265s """ 265s } 265s ), 265s ) 265s 265s tests/test_pydantic.py:157: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = ['--inline-snapshot=fix'] 265s 265s def run_pytest( 265s self, 265s args: list[str] = [], 265s *, 265s term_columns=80, 265s env: dict[str, str] = {}, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s stderr: Snapshot[str] | None = None, 265s returncode: Snapshot[int] | None = None, 265s ) -> Example: 265s """Run pytest with the given args and env variables in an seperate 265s process. 265s 265s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 265s 265s Parameters: 265s args: pytest arguments like "--inline-snapshot=fix" 265s env: dict of environment variables 265s changed_files: snapshot of files which are changed by this run. 265s report: snapshot of the report at the end of the pytest run. 265s stderr: pytest stderr output 265s returncode: snapshot of the pytest returncode. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s self._write_files(tmp_path) 265s 265s cmd = [sys.executable, "-m", "pytest", *args] 265s 265s command_env = dict(os.environ) 265s command_env["TERM"] = "unknown" 265s command_env["COLUMNS"] = str( 265s term_columns + 1 if platform.system() == "Windows" else term_columns 265s ) 265s command_env.pop("CI", None) 265s 265s command_env.update(env) 265s 265s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 265s 265s print("run>", *cmd) 265s print("stdout:") 265s print(result.stdout.decode()) 265s print("stderr:") 265s print(result.stderr.decode()) 265s 265s if returncode is not None: 265s assert result.returncode == returncode 265s 265s if stderr is not None: 265s assert result.stderr.decode() == stderr 265s 265s if report is not None: 265s 265s report_list = [] 265s record = False 265s for line in result.stdout.decode().splitlines(): 265s line = line.strip() 265s if line.startswith("===="): 265s record = False 265s 265s if record and line: 265s report_list.append(line) 265s 265s if line.startswith("====") and "inline snapshot" in line: 265s record = True 265s 265s report_str = "\n".join(report_list) 265s 265s assert normalize(report_str) == report, repr(report_str) 265s 265s if changed_files is not None: 265s current_files = {} 265s 265s for name, content in sorted(self._read_files(tmp_path).items()): 265s if name not in self.files or self.files[name] != content: 265s current_files[name] = content 265s > assert changed_files == current_files 265s E AssertionError: assert {'test_someth...ot(A(a=2))\n'} == {} 265s E 265s E Left contains 1 more item: 265s E {'test_something.py': 'from inline_snapshot import snapshot\n' 265s E 'from pydantic import BaseModel\n' 265s E '\n' 265s E 'class A(BaseModel):\n' 265s E ' a:int\n'... 265s E 265s E ...Full output truncated (9 lines hidden), use '-vv' to show 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot 265s from pydantic import BaseModel 265s 265s class A(BaseModel): 265s a:int 265s 265s @classmethod 265s def from_str(cls,s): 265s return cls(a=int(s)) 265s 265s def test_something(): 265s for a in [1,2]: 265s assert A(a=2) == snapshot(A.from_str("1")) 265s 265s 265s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmpez7lbl7_ 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_something.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ________________________________ test_something ________________________________ 265s 265s def test_something(): 265s for a in [1,2]: 265s > assert A(a=2) == snapshot(A.from_str("1")) 265s 265s test_something.py:13: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:107: in assign 265s result = yield from self.value_assign(old_value, old_node, new_value) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py:87: in value_assign 265s result = yield from adapter.assign(old_value, old_node, new_value) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = 'A (a =2 )', filename = PosixPath('/tmp/tmpez7lbl7_/test_something.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_something.py::test_something - TypeError: CliRunner.__init__() go... 265s ============================== 1 failed in 0.34s =============================== 265s 265s stderr: 265s 265s __________________________________ test_pypy ___________________________________ 265s 265s @pytest.mark.no_rewriting 265s def test_pypy(): 265s report = ( 265s snapshot("INFO: inline-snapshot was disabled because pypy is not supported") 265s if sys.implementation.name == "pypy" 265s else snapshot( 265s """\ 265s -------------------------------- Fix snapshots --------------------------------- 265s +----------------------------- test_something.py ------------------------------+ 265s | @@ -1,6 +1,6 @@ | 265s | | 265s | from inline_snapshot import snapshot | 265s | | 265s | def test_example(): | 265s | - assert 1+1==snapshot(3) | 265s | + assert 1+1==snapshot(2) | 265s +------------------------------------------------------------------------------+ 265s These changes will be applied, because you used --inline-snapshot=fix\ 265s """ 265s ) 265s ) 265s 265s Example( 265s """\ 265s from inline_snapshot import snapshot 265s 265s def test_example(): 265s assert 1+1==snapshot(3) 265s 265s """ 265s > ).run_pytest(["--inline-snapshot=fix"], report=report).run_pytest( 265s ["--inline-snapshot=disable"], report="" 265s ) 265s 265s tests/test_pypy.py:38: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:319: in run_pytest 265s assert normalize(report_str) == report, repr(report_str) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = "''" 265s filename = PosixPath('/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_pypy.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_something.py 265s from inline_snapshot import snapshot 265s 265s def test_example(): 265s assert 1+1==snapshot(3) 265s 265s 265s 265s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmp2mx86lo2 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_something.py F [100%] 265s 265s =================================== FAILURES =================================== 265s _________________________________ test_example _________________________________ 265s 265s def test_example(): 265s > assert 1+1==snapshot(3) 265s 265s test_something.py:4: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '2 ', filename = PosixPath('/tmp/tmp2mx86lo2/test_something.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_something.py::test_example - TypeError: CliRunner.__init__() got ... 265s ============================== 1 failed in 0.25s =============================== 265s 265s stderr: 265s 265s _________________________________ test_create __________________________________ 265s 265s project = .Project object at 0x611fc1162390> 265s 265s def test_create(project): 265s project.setup( 265s """\ 265s def test_a(): 265s assert 5==snapshot() 265s """ 265s ) 265s 265s result = project.run() 265s 265s > result.assert_outcomes(errors=1, passed=1) 265s E AssertionError: assert {'errors': 1,...pped': 0, ...} == {'errors': 1,...pped': 0, ...} 265s E 265s E Omitting 4 identical items, use -vv to show 265s E Differing items: 265s E {'passed': 0} != {'passed': 1} 265s E {'failed': 1} != {'failed': 0} 265s E Use -v to get more diff 265s 265s /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_pytest_plugin.py:24: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s write code: 265s # äöß 🐍 265s from inline_snapshot import snapshot 265s from inline_snapshot import outsource 265s 265s 265s def test_a(): 265s assert 5==snapshot() 265s 265s running: pytest 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_create0 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_create0 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_file.py FE [100%] 265s 265s ==================================== ERRORS ==================================== 265s _________________________ ERROR at teardown of test_a __________________________ 265s your snapshot is missing one value. 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s > assert 5==snapshot() 265s 265s test_file.py:7: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_create0/test_file.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 265s ERROR test_file.py::test_a - Failed: your snapshot is missing one value. 265s ========================== 1 failed, 1 error in 0.33s ========================== 265s ___________________________________ test_fix ___________________________________ 265s 265s project = .Project object at 0x611fc111db50> 265s 265s def test_fix(project): 265s project.setup( 265s """\ 265s def test_a(): 265s assert 5==snapshot(4) 265s """ 265s ) 265s 265s result = project.run() 265s 265s > result.assert_outcomes(failed=1, errors=1) 265s E AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 1,...pped': 0, ...} 265s E 265s E Omitting 5 identical items, use -vv to show 265s E Differing items: 265s E {'errors': 0} != {'errors': 1} 265s E Use -v to get more diff 265s 265s /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_pytest_plugin.py:71: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s write code: 265s # äöß 🐍 265s from inline_snapshot import snapshot 265s from inline_snapshot import outsource 265s 265s 265s def test_a(): 265s assert 5==snapshot(4) 265s 265s running: pytest 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_fix0 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_fix0 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_file.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s > assert 5==snapshot(4) 265s 265s test_file.py:7: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '5 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix0/test_file.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 265s ============================== 1 failed in 0.39s =============================== 265s _________________________________ test_update __________________________________ 265s 265s project = .Project object at 0x611fc111eba0> 265s 265s def test_update(project): 265s project.setup( 265s """\ 265s def test_a(): 265s assert "5" == snapshot('''5''') 265s """ 265s ) 265s 265s result = project.run() 265s 265s > result.assert_outcomes(passed=1) 265s E AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...} 265s E 265s E Omitting 4 identical items, use -vv to show 265s E Differing items: 265s E {'passed': 0} != {'passed': 1} 265s E {'failed': 1} != {'failed': 0} 265s E Use -v to get more diff 265s 265s /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_pytest_plugin.py:118: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s write code: 265s # äöß 🐍 265s from inline_snapshot import snapshot 265s from inline_snapshot import outsource 265s 265s 265s def test_a(): 265s assert "5" == snapshot('''5''') 265s 265s running: pytest 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_update0 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_update0 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_file.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s > assert "5" == snapshot('''5''') 265s 265s test_file.py:7: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = "'5'" 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_update0/test_file.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 265s ============================== 1 failed in 0.37s =============================== 265s __________________________________ test_trim ___________________________________ 265s 265s project = .Project object at 0x611fc111fbf0> 265s 265s def test_trim(project): 265s project.setup( 265s """\ 265s def test_a(): 265s assert 5 in snapshot([4,5]) 265s """ 265s ) 265s 265s result = project.run() 265s 265s result.assert_outcomes(passed=1) 265s 265s assert result.report == snapshot( 265s """\ 265s Info: one snapshot can be trimmed (--inline-snapshot=trim) 265s You can also use --inline-snapshot=review to approve the changes interactively 265s """ 265s ) 265s 265s result = project.run("--inline-snapshot=trim") 265s 265s > assert result.report == snapshot( 265s """\ 265s -------------------------------- Trim snapshots -------------------------------- 265s +-------------------------------- test_file.py --------------------------------+ 265s | @@ -4,4 +4,4 @@ | 265s | | 265s | | 265s | | 265s | def test_a(): | 265s | - assert 5 in snapshot([4,5]) | 265s | + assert 5 in snapshot([5]) | 265s +------------------------------------------------------------------------------+ 265s These changes will be applied, because you used --inline-snapshot=trim 265s """ 265s ) 265s 265s /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_pytest_plugin.py:178: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = "'-------------------------------- Trim snapshots --------------------------------'" 265s filename = PosixPath('/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_pytest_plugin.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s write code: 265s # äöß 🐍 265s from inline_snapshot import snapshot 265s from inline_snapshot import outsource 265s 265s 265s def test_a(): 265s assert 5 in snapshot([4,5]) 265s 265s running: pytest 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_trim0 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_trim0 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_file.py . [100%] 265s =============================== inline snapshot ================================ 265s Info: one snapshot can be trimmed (--inline-snapshot=trim) 265s 265s You can also use --inline-snapshot=review to approve the changes interactively 265s 265s ============================== 1 passed in 0.21s =============================== 265s running: pytest --inline-snapshot=trim 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_trim0 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_trim0 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_file.py . [100%] 265s =============================== inline snapshot ================================ 265s ──────────────────────────────── Trim snapshots ──────────────────────────────── 265s ----------------------------- Captured stderr call ----------------------------- 265s Traceback (most recent call last): 265s File "/usr/bin/pytest", line 8, in 265s sys.exit(console_main()) 265s ~~~~~~~~~~~~^^ 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 265s code = main() 265s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 265s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 265s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 265s return wrap_session(config, _main) 265s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 265s config.hook.pytest_sessionfinish( 265s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 265s session=session, exitstatus=session.exitstatus 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s ) 265s ^ 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ~~~~~~~~~~~~~~^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 265s teardown.send(result) # type: ignore[union-attr] 265s ~~~~~~~~~~~~~^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 265s self.config.hook.pytest_terminal_summary( 265s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 265s terminalreporter=self, exitstatus=exitstatus, config=self.config 265s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s ) 265s ^ 265s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 265s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 265s ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 265s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 265s ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 265s raise exception.with_traceback(exception.__traceback__) 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ~~~~~~~~~~~~~~^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 265s teardown.throw(exception) # type: ignore[union-attr] 265s ~~~~~~~~~~~~~~^^^^^^^^^^^ 265s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 265s return (yield) 265s ^^^^^ 265s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 265s res = hook_impl.function(*args) 265s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary 265s diff = file.diff() 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff 265s unified_diff(self.source.splitlines(), self.new_code().splitlines()), 265s ~~~~~~~~~~~~~^^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s ~~~~~~~~~~~^ 265s code, self.filename 265s ^^^^^^^^^^^^^^^^^^^ 265s ) 265s ^ 265s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 265s runner = CliRunner(mix_stderr=False) 265s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s ________________________________ test_multiple _________________________________ 265s 265s project = .Project object at 0x611fc0fdf020> 265s 265s def test_multiple(project): 265s project.setup( 265s """\ 265s def test_a(): 265s assert "5" == snapshot('''5''') 265s assert 5 <= snapshot(8) 265s assert 5 == snapshot(4) 265s """ 265s ) 265s 265s result = project.run() 265s 265s > result.assert_outcomes(failed=1, errors=1) 265s E AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 1,...pped': 0, ...} 265s E 265s E Omitting 5 identical items, use -vv to show 265s E Differing items: 265s E {'errors': 0} != {'errors': 1} 265s E Use -v to get more diff 265s 265s /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_pytest_plugin.py:214: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s write code: 265s # äöß 🐍 265s from inline_snapshot import snapshot 265s from inline_snapshot import outsource 265s 265s 265s def test_a(): 265s assert "5" == snapshot('''5''') 265s assert 5 <= snapshot(8) 265s assert 5 == snapshot(4) 265s 265s running: pytest 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_multiple0 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_multiple0 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_file.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s > assert "5" == snapshot('''5''') 265s 265s test_file.py:7: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = "'5'" 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_multiple0/test_file.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 265s ============================== 1 failed in 0.33s =============================== 265s _____________________________ test_multiple_report _____________________________ 265s 265s project = .Project object at 0x611fc0ef4f20> 265s 265s def test_multiple_report(project): 265s project.setup( 265s """\ 265s def test_a(): 265s assert "5" == snapshot('''5''') 265s assert 5 <= snapshot(8) 265s assert 5 == snapshot(4) 265s """ 265s ) 265s 265s result = project.run("--inline-snapshot=trim,report") 265s 265s > assert result.report == snapshot( 265s """\ 265s -------------------------------- Fix snapshots --------------------------------- 265s +-------------------------------- test_file.py --------------------------------+ 265s | @@ -6,4 +6,4 @@ | 265s | | 265s | def test_a(): | 265s | assert "5" == snapshot('''5''') | 265s | assert 5 <= snapshot(8) | 265s | - assert 5 == snapshot(4) | 265s | + assert 5 == snapshot(5) | 265s +------------------------------------------------------------------------------+ 265s These changes are not applied. 265s Use --inline-snapshot=fix to apply them, or use the interactive mode with 265s --inline-snapshot=review 265s -------------------------------- Trim snapshots -------------------------------- 265s +-------------------------------- test_file.py --------------------------------+ 265s | @@ -5,5 +5,5 @@ | 265s | | 265s | | 265s | def test_a(): | 265s | assert "5" == snapshot('''5''') | 265s | - assert 5 <= snapshot(8) | 265s | + assert 5 <= snapshot(5) | 265s | assert 5 == snapshot(4) | 265s +------------------------------------------------------------------------------+ 265s These changes will be applied, because you used --inline-snapshot=trim 265s ------------------------------- Update snapshots ------------------------------- 265s +-------------------------------- test_file.py --------------------------------+ 265s | @@ -4,6 +4,6 @@ | 265s | | 265s | | 265s | | 265s | def test_a(): | 265s | - assert "5" == snapshot('''5''') | 265s | + assert "5" == snapshot("5") | 265s | assert 5 <= snapshot(5) | 265s | assert 5 == snapshot(4) | 265s +------------------------------------------------------------------------------+ 265s These changes are not applied. 265s Use --inline-snapshot=update to apply them, or use the interactive mode with 265s --inline-snapshot=review 265s """ 265s ) 265s 265s /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_pytest_plugin.py:307: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = "''" 265s filename = PosixPath('/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_pytest_plugin.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s write code: 265s # äöß 🐍 265s from inline_snapshot import snapshot 265s from inline_snapshot import outsource 265s 265s 265s def test_a(): 265s assert "5" == snapshot('''5''') 265s assert 5 <= snapshot(8) 265s assert 5 == snapshot(4) 265s 265s running: pytest --inline-snapshot=trim,report 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_multiple_report0 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_multiple_report0 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_file.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s > assert "5" == snapshot('''5''') 265s 265s test_file.py:7: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = "'5'" 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_multiple_report0/test_file.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 265s ============================== 1 failed in 0.33s =============================== 265s ______________________________ test_black_config _______________________________ 265s 265s project = .Project object at 0x611fc0ef7680> 265s 265s def test_black_config(project): 265s project.setup( 265s """\ 265s def test_a(): 265s assert list(range(10)) == snapshot([]) 265s """ 265s ) 265s 265s > project.format() 265s 265s /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_pytest_plugin.py:370: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/conftest.py:315: in format 265s format_code(self._filename.read_text("utf-8"), self._filename), "utf-8" 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import outsource\n\n\ndef test_a():\n assert list(range(10)) == snapshot([])\n' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_black_config0/test_file.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s write code: 265s # äöß 🐍 265s from inline_snapshot import snapshot 265s from inline_snapshot import outsource 265s 265s 265s def test_a(): 265s assert list(range(10)) == snapshot([]) 265s 265s ________________________________ test_disabled _________________________________ 265s 265s project = .Project object at 0x611fc0ef6330> 265s 265s def test_disabled(project): 265s project.setup( 265s """\ 265s def test_a(): 265s assert 4==snapshot(5) 265s """ 265s ) 265s 265s result = project.run("--inline-snapshot=disable") 265s result.assert_outcomes(failed=1) 265s 265s result = project.run("--inline-snapshot=fix") 265s > assert project.source == snapshot( 265s """\ 265s def test_a(): 265s assert 4==snapshot(4) 265s """ 265s ) 265s 265s /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_pytest_plugin.py:409: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '"""\\\ndef test_a():\n assert 4==snapshot(5)\n"""' 265s filename = PosixPath('/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_pytest_plugin.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s write code: 265s # äöß 🐍 265s from inline_snapshot import snapshot 265s from inline_snapshot import outsource 265s 265s 265s def test_a(): 265s assert 4==snapshot(5) 265s 265s running: pytest --inline-snapshot=disable 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_disabled0 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_disabled0 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_file.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s > assert 4==snapshot(5) 265s E assert 4 == 5 265s E + where 5 = snapshot(5) 265s 265s test_file.py:7: AssertionError 265s =========================== short test summary info ============================ 265s FAILED test_file.py::test_a - assert 4 == 5 265s ============================== 1 failed in 0.21s =============================== 265s running: pytest --inline-snapshot=fix 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_disabled0 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_disabled0 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_file.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s > assert 4==snapshot(5) 265s 265s test_file.py:7: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '4 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_disabled0/test_file.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 265s ============================== 1 failed in 0.32s =============================== 265s _________________________________ test_compare _________________________________ 265s 265s project = .Project object at 0x611fc0eb88f0> 265s 265s def test_compare(project): 265s project.setup( 265s """\ 265s def test_a(): 265s assert "a"==snapshot("b") 265s """ 265s ) 265s 265s result = project.run() 265s > assert result.errorLines() == snapshot( 265s """\ 265s > assert "a"==snapshot("b") 265s E AssertionError: assert 'a' == 'b' 265s E ⏎ 265s E - b 265s E + a 265s """ 265s ) 265s 265s /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_pytest_plugin.py:429: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '"""\\\n> assert "a"==snapshot("b")\n> runner = CliRunner(mix_stderr=False)\nE TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\n"""' 265s filename = PosixPath('/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_pytest_plugin.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s write code: 265s # äöß 🐍 265s from inline_snapshot import snapshot 265s from inline_snapshot import outsource 265s 265s 265s def test_a(): 265s assert "a"==snapshot("b") 265s 265s running: pytest 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_compare0 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_compare0 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_file.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s > assert "a"==snapshot("b") 265s 265s test_file.py:7: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = "'a'" 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_compare0/test_file.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 265s ============================== 1 failed in 0.35s =============================== 265s __________________________ test_assertion_error_loop ___________________________ 265s 265s project = .Project object at 0x611fc11ffe30> 265s 265s def test_assertion_error_loop(project): 265s project.setup( 265s """\ 265s for e in (1, 2): 265s assert e == snapshot() 265s """ 265s ) 265s result = project.run() 265s > assert result.errorLines() == snapshot( 265s """\ 265s E assert 2 == 1 265s E + where 1 = snapshot() 265s """ 265s ) 265s 265s /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_pytest_plugin.py:466: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '"E TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'"' 265s filename = PosixPath('/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_pytest_plugin.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s write code: 265s # äöß 🐍 265s from inline_snapshot import snapshot 265s from inline_snapshot import outsource 265s 265s 265s for e in (1, 2): 265s assert e == snapshot() 265s 265s running: pytest 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_assertion_error_loop0 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_assertion_error_loop0 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 0 items / 1 error 265s 265s ==================================== ERRORS ==================================== 265s ________________________ ERROR collecting test_file.py _________________________ 265s test_file.py:7: in 265s assert e == snapshot() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 265s runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s ERROR test_file.py - TypeError: CliRunner.__init__() got an unexpected keywor... 265s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 265s =============================== 1 error in 0.30s =============================== 265s _____________________________ test_assertion_error _____________________________ 265s 265s project = .Project object at 0x611fc0eba5a0> 265s 265s def test_assertion_error(project): 265s project.setup("assert 2 == snapshot(1)") 265s result = project.run() 265s > assert result.errorLines() == snapshot( 265s """\ 265s E assert 2 == 1 265s E + where 1 = snapshot(1) 265s """ 265s ) 265s 265s /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_pytest_plugin.py:493: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '"E TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'"' 265s filename = PosixPath('/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_pytest_plugin.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s write code: 265s # äöß 🐍 265s from inline_snapshot import snapshot 265s from inline_snapshot import outsource 265s 265s 265s assert 2 == snapshot(1) 265s running: pytest 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_assertion_error0 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_assertion_error0 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 0 items / 1 error 265s 265s ==================================== ERRORS ==================================== 265s ________________________ ERROR collecting test_file.py _________________________ 265s test_file.py:6: in 265s assert 2 == snapshot(1) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 265s runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s ERROR test_file.py - TypeError: CliRunner.__init__() got an unexpected keywor... 265s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 265s =============================== 1 error in 0.31s =============================== 265s _______________________ test_pytest_inlinesnapshot_auto ________________________ 265s 265s project = .Project object at 0x611fc0eba0c0> 265s 265s def test_pytest_inlinesnapshot_auto(project): 265s project.setup( 265s """\ 265s def test_something(): 265s assert 2 == snapshot(1) 265s """ 265s ) 265s result = project.run("--inline-snapshot=review", stdin=b"y\n") 265s > assert result.errorLines() == snapshot("") 265s 265s /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_pytest_plugin.py:526: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '"""\\\n> assert 2 == snapshot(1)\n> runner = CliRunner(mix_stderr=False)\nE TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\n"""' 265s filename = PosixPath('/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_pytest_plugin.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s write code: 265s # äöß 🐍 265s from inline_snapshot import snapshot 265s from inline_snapshot import outsource 265s 265s 265s def test_something(): 265s assert 2 == snapshot(1) 265s 265s running: pytest --inline-snapshot=review 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_inlinesnapshot_auto0 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_inlinesnapshot_auto0 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_file.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ________________________________ test_something ________________________________ 265s 265s def test_something(): 265s > assert 2 == snapshot(1) 265s 265s test_file.py:7: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '2 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_inlinesnapshot_auto0/test_file.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_file.py::test_something - TypeError: CliRunner.__init__() got an ... 265s ============================== 1 failed in 0.34s =============================== 265s ________________________ test_persist_unknown_external _________________________ 265s 265s project = .Project object at 0x611fc0edb590> 265s 265s def test_persist_unknown_external(project): 265s project.setup( 265s """\ 265s from inline_snapshot import external, snapshot 265s 265s def test_sub_snapshot(): 265s external("123*.png") 265s assert 1==snapshot(2) 265s """ 265s ) 265s 265s result = project.run("--inline-snapshot=fix") 265s 265s > assert project.source == snapshot( 265s """\ 265s from inline_snapshot import external, snapshot 265s 265s def test_sub_snapshot(): 265s external("123*.png") 265s assert 1==snapshot(1) 265s """ 265s ) 265s 265s /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_pytest_plugin.py:596: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '"""\\\nfrom inline_snapshot import external, snapshot\n\ndef test_sub_snapshot():\n external("123*.png")\n assert 1==snapshot(2)\n"""' 265s filename = PosixPath('/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_pytest_plugin.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s write code: 265s # äöß 🐍 265s from inline_snapshot import snapshot 265s from inline_snapshot import outsource 265s from inline_snapshot import external, snapshot 265s 265s def test_sub_snapshot(): 265s external("123*.png") 265s assert 1==snapshot(2) 265s 265s running: pytest --inline-snapshot=fix 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_persist_unknown_external0 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_persist_unknown_external0 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_file.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ______________________________ test_sub_snapshot _______________________________ 265s 265s def test_sub_snapshot(): 265s external("123*.png") 265s > assert 1==snapshot(2) 265s 265s test_file.py:8: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '1 ' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_persist_unknown_external0/test_file.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_file.py::test_sub_snapshot - TypeError: CliRunner.__init__() got ... 265s ============================== 1 failed in 0.32s =============================== 265s ___________________________ test_diff_multiple_files ___________________________ 265s 265s def test_diff_multiple_files(): 265s 265s Example( 265s { 265s "test_a.py": """ 265s from inline_snapshot import snapshot 265s 265s def test_a(): 265s assert 1==snapshot(2) 265s """, 265s "test_b.py": """ 265s from inline_snapshot import snapshot 265s 265s def test_b(): 265s assert 1==snapshot() 265s """, 265s } 265s > ).run_pytest( 265s ["--inline-snapshot=create,fix"], 265s changed_files=snapshot( 265s { 265s "test_b.py": """\ 265s 265s from inline_snapshot import snapshot 265s 265s def test_b(): 265s assert 1==snapshot(1) 265s \ 265s """, 265s "test_a.py": """\ 265s 265s from inline_snapshot import snapshot 265s 265s def test_a(): 265s assert 1==snapshot(1) 265s \ 265s """, 265s } 265s ), 265s report=snapshot( 265s """\ 265s ------------------------------- Create snapshots ------------------------------- 265s +--------------------------------- test_b.py ----------------------------------+ 265s | @@ -2,5 +2,5 @@ | 265s | | 265s | from inline_snapshot import snapshot | 265s | | 265s | def test_b(): | 265s | - assert 1==snapshot() | 265s | + assert 1==snapshot(1) | 265s +------------------------------------------------------------------------------+ 265s These changes will be applied, because you used --inline-snapshot=create 265s -------------------------------- Fix snapshots --------------------------------- 265s +--------------------------------- test_a.py ----------------------------------+ 265s | @@ -2,5 +2,5 @@ | 265s | | 265s | from inline_snapshot import snapshot | 265s | | 265s | def test_a(): | 265s | - assert 1==snapshot(2) | 265s | + assert 1==snapshot(1) | 265s +------------------------------------------------------------------------------+ 265s These changes will be applied, because you used --inline-snapshot=fix\ 265s """ 265s ), 265s ) 265s 265s tests/test_pytest_plugin.py:626: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:319: in run_pytest 265s assert normalize(report_str) == report, repr(report_str) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = "''" 265s filename = PosixPath('/tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_pytest_plugin.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: test_a.py 265s 265s from inline_snapshot import snapshot 265s 265s def test_a(): 265s assert 1==snapshot(2) 265s 265s 265s file: test_b.py 265s 265s from inline_snapshot import snapshot 265s 265s def test_b(): 265s assert 1==snapshot() 265s 265s 265s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create,fix 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmp13t_n9tn 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 2 items 265s 265s test_a.py F [ 50%] 265s test_b.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ____________________________________ test_a ____________________________________ 265s 265s def test_a(): 265s > assert 1==snapshot(2) 265s 265s test_a.py:5: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '1 ', filename = PosixPath('/tmp/tmp13t_n9tn/test_a.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ____________________________________ test_b ____________________________________ 265s 265s def test_b(): 265s > assert 1==snapshot() 265s 265s test_b.py:5: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '', filename = PosixPath('/tmp/tmp13t_n9tn/test_b.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 265s FAILED test_b.py::test_b - TypeError: CliRunner.__init__() got an unexpected ... 265s ============================== 2 failed in 0.27s =============================== 265s 265s stderr: 265s 265s ___________________ test_storage_dir_config[tests/snapshots] ___________________ 265s 265s project = .Project object at 0x611fc0d6d6d0> 265s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config_tests_0') 265s storage_dir = 'tests/snapshots' 265s 265s @pytest.mark.parametrize("storage_dir", ["tests/snapshots", None]) 265s def test_storage_dir_config(project, tmp_path, storage_dir): 265s # Relative path case: `tests/snapshots` (parametrized). 265s # Absolute path case: `tmp_path / "snapshots"` (parametrized as `None`). 265s if not storage_dir: 265s storage_dir = tmp_path / "snapshots" 265s 265s project.pyproject( 265s f""" 265s [tool.inline-snapshot] 265s storage-dir = "{storage_dir}" 265s """ 265s ) 265s 265s project.setup( 265s """ 265s from inline_snapshot import outsource, snapshot 265s 265s def test_outsource(): 265s assert outsource("hello", suffix=".html") == snapshot() 265s """ 265s ) 265s 265s result = project.run("--inline-snapshot=create") 265s > assert result.ret == 0 265s E assert == 0 265s E + where = .ret 265s 265s /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_pytest_plugin.py:754: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s write code: 265s # äöß 🐍 265s from inline_snapshot import snapshot 265s from inline_snapshot import outsource 265s 265s 265s 265s from inline_snapshot import outsource, snapshot 265s 265s def test_outsource(): 265s assert outsource("hello", suffix=".html") == snapshot() 265s 265s running: pytest --inline-snapshot=create 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config0 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config0 265s configfile: pyproject.toml 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_file.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ________________________________ test_outsource ________________________________ 265s 265s def test_outsource(): 265s > assert outsource("hello", suffix=".html") == snapshot() 265s 265s test_file.py:10: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config0/test_file.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_file.py::test_outsource - TypeError: CliRunner.__init__() got an ... 265s ============================== 1 failed in 0.31s =============================== 265s ________________________ test_storage_dir_config[None] _________________________ 265s 265s project = .Project object at 0x611fc0d6da90> 265s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config_None_0') 265s storage_dir = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config_None_0/snapshots') 265s 265s @pytest.mark.parametrize("storage_dir", ["tests/snapshots", None]) 265s def test_storage_dir_config(project, tmp_path, storage_dir): 265s # Relative path case: `tests/snapshots` (parametrized). 265s # Absolute path case: `tmp_path / "snapshots"` (parametrized as `None`). 265s if not storage_dir: 265s storage_dir = tmp_path / "snapshots" 265s 265s project.pyproject( 265s f""" 265s [tool.inline-snapshot] 265s storage-dir = "{storage_dir}" 265s """ 265s ) 265s 265s project.setup( 265s """ 265s from inline_snapshot import outsource, snapshot 265s 265s def test_outsource(): 265s assert outsource("hello", suffix=".html") == snapshot() 265s """ 265s ) 265s 265s result = project.run("--inline-snapshot=create") 265s > assert result.ret == 0 265s E assert == 0 265s E + where = .ret 265s 265s /tmp/autopkgtest.rJ2kKZ/autopkgtest_tmp/tests/test_pytest_plugin.py:754: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s write code: 265s # äöß 🐍 265s from inline_snapshot import snapshot 265s from inline_snapshot import outsource 265s 265s 265s 265s from inline_snapshot import outsource, snapshot 265s 265s def test_outsource(): 265s assert outsource("hello", suffix=".html") == snapshot() 265s 265s running: pytest --inline-snapshot=create 265s in: /tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config1 265s ============================= test session starts ============================== 265s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config1 265s configfile: pyproject.toml 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s test_file.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ________________________________ test_outsource ________________________________ 265s 265s def test_outsource(): 265s > assert outsource("hello", suffix=".html") == snapshot() 265s 265s test_file.py:10: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config1/test_file.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED test_file.py::test_outsource - TypeError: CliRunner.__init__() got an ... 265s ============================== 1 failed in 0.33s =============================== 265s __________________ test_find_pyproject_in_parent_directories ___________________ 265s 265s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_find_pyproject_in_parent_0') 265s 265s def test_find_pyproject_in_parent_directories(tmp_path): 265s 265s Example( 265s { 265s "pyproject.toml": """\ 265s [tool.inline-snapshot] 265s hash-length=2 265s """, 265s "project/pytest.ini": "", 265s "project/test_something.py": """\ 265s from inline_snapshot import outsource,snapshot,external 265s 265s def test_something(): 265s assert outsource("test") == snapshot() 265s """, 265s } 265s > ).run_pytest( 265s ["--rootdir", "./project", "--inline-snapshot=create"], 265s changed_files=snapshot( 265s { 265s "project/test_something.py": """\ 265s from inline_snapshot import outsource,snapshot,external 265s 265s def test_something(): 265s assert outsource("test") == snapshot(external("9f*.txt")) 265s """ 265s } 265s ), 265s ) 265s 265s tests/test_pytest_plugin.py:790: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s self = 265s args = ['--rootdir', './project', '--inline-snapshot=create'] 265s 265s def run_pytest( 265s self, 265s args: list[str] = [], 265s *, 265s term_columns=80, 265s env: dict[str, str] = {}, 265s changed_files: Snapshot[dict[str, str]] | None = None, 265s report: Snapshot[str] | None = None, 265s stderr: Snapshot[str] | None = None, 265s returncode: Snapshot[int] | None = None, 265s ) -> Example: 265s """Run pytest with the given args and env variables in an seperate 265s process. 265s 265s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 265s 265s Parameters: 265s args: pytest arguments like "--inline-snapshot=fix" 265s env: dict of environment variables 265s changed_files: snapshot of files which are changed by this run. 265s report: snapshot of the report at the end of the pytest run. 265s stderr: pytest stderr output 265s returncode: snapshot of the pytest returncode. 265s 265s Returns: 265s A new Example instance which contains the changed files. 265s """ 265s 265s with TemporaryDirectory() as dir: 265s tmp_path = Path(dir) 265s self._write_files(tmp_path) 265s 265s cmd = [sys.executable, "-m", "pytest", *args] 265s 265s command_env = dict(os.environ) 265s command_env["TERM"] = "unknown" 265s command_env["COLUMNS"] = str( 265s term_columns + 1 if platform.system() == "Windows" else term_columns 265s ) 265s command_env.pop("CI", None) 265s 265s command_env.update(env) 265s 265s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 265s 265s print("run>", *cmd) 265s print("stdout:") 265s print(result.stdout.decode()) 265s print("stderr:") 265s print(result.stderr.decode()) 265s 265s if returncode is not None: 265s assert result.returncode == returncode 265s 265s if stderr is not None: 265s assert result.stderr.decode() == stderr 265s 265s if report is not None: 265s 265s report_list = [] 265s record = False 265s for line in result.stdout.decode().splitlines(): 265s line = line.strip() 265s if line.startswith("===="): 265s record = False 265s 265s if record and line: 265s report_list.append(line) 265s 265s if line.startswith("====") and "inline snapshot" in line: 265s record = True 265s 265s report_str = "\n".join(report_list) 265s 265s assert normalize(report_str) == report, repr(report_str) 265s 265s if changed_files is not None: 265s current_files = {} 265s 265s for name, content in sorted(self._read_files(tmp_path).items()): 265s if name not in self.files or self.files[name] != content: 265s current_files[name] = content 265s > assert changed_files == current_files 265s E assert {'project/tes...9f*.txt"))\n'} == {} 265s E 265s E Left contains 1 more item: 265s E {'project/test_something.py': 'from inline_snapshot import ' 265s E 'outsource,snapshot,external\n' 265s E '\n' 265s E 'def test_something():\n' 265s E ' assert outsource("test") == ' 265s E 'snapshot(external("9f*.txt"))\n'} 265s E Use -v to get more diff 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 265s ----------------------------- Captured stdout call ----------------------------- 265s file: pyproject.toml 265s [tool.inline-snapshot] 265s hash-length=2 265s 265s 265s file: project/pytest.ini 265s 265s 265s file: project/test_something.py 265s from inline_snapshot import outsource,snapshot,external 265s 265s def test_something(): 265s assert outsource("test") == snapshot() 265s 265s 265s run> /usr/bin/python3.12 -m pytest --rootdir ./project --inline-snapshot=create 265s stdout: 265s ============================= test session starts ============================== 265s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 265s rootdir: /tmp/tmp29jh7q73/project 265s configfile: ../pyproject.toml 265s plugins: typeguard-4.4.1, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, mock-3.14.0, pytest_freezer-0.4.9, time-machine-2.16.0 265s collected 1 item 265s 265s project/test_something.py F [100%] 265s 265s =================================== FAILURES =================================== 265s ________________________________ test_something ________________________________ 265s 265s def test_something(): 265s > assert outsource("test") == snapshot() 265s 265s project/test_something.py:4: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '', filename = PosixPath('/tmp/tmp29jh7q73/project/test_something.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s =============================== inline snapshot ================================ 265s =========================== short test summary info ============================ 265s FAILED project/test_something.py::test_something - TypeError: CliRunner.__ini... 265s ============================== 1 failed in 0.25s =============================== 265s 265s stderr: 265s 265s _________________________________ test_rewrite _________________________________ 265s 265s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_rewrite0') 265s 265s def test_rewrite(tmp_path): 265s file = tmp_path / "file.txt" 265s file.write_text( 265s """ 265s 12345 265s 12345 265s 12345 265s """, 265s "utf-8", 265s ) 265s 265s with ChangeRecorder().activate() as recorder: 265s s = recorder.change_set() 265s 265s s.replace(((2, 2), (2, 3)), "a", filename=file) 265s s.delete(((3, 2), (3, 3)), filename=file) 265s s.insert((4, 2), "c", filename=file) 265s 265s assert recorder.num_fixes() == 1 265s > recorder.fix_all() 265s 265s tests/test_rewrite_code.py:43: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 265s file.rewrite() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 265s new_code = self.new_code() 265s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 265s format_whole_file = enforce_formatting() or code == format_code( 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '\n12345\n12345\n12345\n' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_rewrite0/file.txt') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ______________________________ test_string_update ______________________________ 265s 265s check_update = .w at 0x611fc0ec34c0> 265s 265s def test_string_update(check_update): 265s # black --preview wraps strings to keep the line length. 265s # string concatenation should produce updates. 265s assert ( 265s check_update( 265s 'assert "ab" == snapshot("a" "b")', reported_flags="", flags="update" 265s ) 265s == 'assert "ab" == snapshot("a" "b")' 265s ) 265s 265s assert ( 265s check_update( 265s 'assert "ab" == snapshot("a"\n "b")', reported_flags="", flags="update" 265s ) 265s == 'assert "ab" == snapshot("a"\n "b")' 265s ) 265s 265s > assert check_update( 265s 'assert "ab\\nc" == snapshot("a"\n "b\\nc")', flags="update" 265s ) == snapshot( 265s '''\ 265s assert "ab\\nc" == snapshot("""\\ 265s ab 265s c\\ 265s """)\ 265s ''' 265s ) 265s 265s tests/test_string.py:26: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:114: in run 265s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 265s /tmp/pytest-of-ubuntu/pytest-0/test_string_update0/test_5.py:9: in 265s assert "ab\nc" == snapshot("a" 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 265s return self == other 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 265s self._changes.append(next(it)) 265s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 265s new_code = self.context.file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '"""\\\nab\nc\\\n"""' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_string_update0/test_5.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert "ab" == snapshot("a" "b") 265s reported_flags: set() 265s run: pytest --inline-snapshot= 265s output: 265s |assert "ab" == snapshot("a" "b") 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert "ab" == snapshot("a" "b") 265s reported_flags: set() 265s run: pytest --inline-snapshot=update 265s output: 265s |assert "ab" == snapshot("a" "b") 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert "ab" == snapshot("a" 265s | "b") 265s reported_flags: set() 265s run: pytest --inline-snapshot= 265s output: 265s |assert "ab" == snapshot("a" 265s | "b") 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert "ab" == snapshot("a" 265s | "b") 265s reported_flags: set() 265s run: pytest --inline-snapshot=update 265s output: 265s |assert "ab" == snapshot("a" 265s | "b") 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |assert "ab\nc" == snapshot("a" 265s | "b\nc") 265s _____________________________ test_string_newline ______________________________ 265s 265s check_update = .w at 0x611fc0ec3740> 265s 265s def test_string_newline(check_update): 265s > assert check_update('s = snapshot("a\\nb")', flags="update") == snapshot( 265s '''\ 265s s = snapshot("""\\ 265s a 265s b\\ 265s """)\ 265s ''' 265s ) 265s 265s tests/test_string.py:46: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:218: in _get_changes 265s yield from handle(self._ast_node, self._old_value) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:206: in handle 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '"""\\\na\nb\\\n"""' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_string_newline0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot("a\nb") 265s ___________________________ test_string_quote_choice ___________________________ 265s 265s check_update = .w at 0x611fc0dad8a0> 265s 265s def test_string_quote_choice(check_update): 265s > assert check_update( 265s "s = snapshot(\" \\'\\'\\' \\'\\'\\' \\\"\\\"\\\"\\nother_line\")", 265s flags="update", 265s ) == snapshot( 265s '''\ 265s s = snapshot("""\\ 265s \'\'\' \'\'\' \\"\\"\\" 265s other_line\\ 265s """)\ 265s ''' 265s ) 265s 265s tests/test_string.py:115: 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s tests/conftest.py:49: in w 265s s = source(source_code) 265s tests/conftest.py:158: in w 265s return Source(source=source).run() 265s tests/conftest.py:125: in run 265s changes += snapshot._changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 265s yield from self._value._get_changes() 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:218: in _get_changes 265s yield from handle(self._ast_node, self._old_value) 265s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:206: in handle 265s new_code = self._file._token_to_code(new_token) 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 265s return self._format(tokenize.untokenize(tokens)).strip() 265s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 265s return format_code(text, Path(self._source.filename)) 265s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 265s 265s text = '"""\\\n \'\'\' \'\'\' \\"\\"\\"\nother_line\\\n"""' 265s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_string_quote_choice0/test_1.py') 265s 265s def format_code(text, filename): 265s if _config.config.format_command is not None: 265s format_command = _config.config.format_command.format(filename=filename) 265s result = sp.run( 265s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 265s ) 265s if result.returncode != 0: 265s raise_problem( 265s f"""\ 265s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 265s """ 265s + result.stdout.decode("utf-8") 265s + result.stderr.decode("utf-8") 265s ) 265s return text 265s return result.stdout.decode("utf-8") 265s 265s try: 265s from black import main 265s from click.testing import CliRunner 265s except ImportError: 265s raise_problem( 265s f"""\ 265s [b]inline-snapshot is not able to format your code.[/b] 265s This issue can be solved by: 265s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 265s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 265s """ 265s ) 265s return text 265s 265s with warnings.catch_warnings(): 265s warnings.simplefilter("ignore") 265s 265s > runner = CliRunner(mix_stderr=False) 265s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 265s 265s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 265s ----------------------------- Captured stdout call ----------------------------- 265s 265s input: 265s |""" 265s |PYTEST_DONT_REWRITE 265s |""" 265s |# äöß 🐍 265s |from inline_snapshot import snapshot 265s |from inline_snapshot import external 265s |from inline_snapshot import outsource 265s | 265s |s = snapshot(" \'\'\' \'\'\' \"\"\"\nother_line") 265s =============================== warnings summary =============================== 265s tests/adapter/test_sequence.py:64 265s /tmp/autopkgtest.rJ2kKZ/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 265s @pytest.mark.no_rewriting 265s 265s tests/test_inline_snapshot.py:17 265s /tmp/autopkgtest.rJ2kKZ/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 265s @pytest.mark.no_rewriting 265s 265s tests/test_inline_snapshot.py:24 265s /tmp/autopkgtest.rJ2kKZ/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 265s @pytest.mark.no_rewriting 265s 265s tests/test_pypy.py:8 265s /tmp/autopkgtest.rJ2kKZ/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 265s @pytest.mark.no_rewriting 265s 265s tests/test_pytest_plugin.py:275 265s /tmp/autopkgtest.rJ2kKZ/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 265s @pytest.mark.no_rewriting 265s 265s tests/test_pytest_plugin.py:501 265s /tmp/autopkgtest.rJ2kKZ/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 265s @pytest.mark.no_rewriting 265s 265s -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html 265s =============================== inline snapshot ================================ 265s Error: one snapshot has incorrect values (--inline-snapshot=fix) 265s 265s You can also use --inline-snapshot=review to approve the changes interactively 265s =========================== short test summary info ============================ 265s FAILED tests/adapter/test_dataclass.py::test_unmanaged - TypeError: CliRunner... 265s FAILED tests/adapter/test_dataclass.py::test_reeval - assert None == ('TypeEr... 265s FAILED tests/adapter/test_dataclass.py::test_dataclass_default_value - TypeEr... 265s FAILED tests/adapter/test_dataclass.py::test_attrs_default_value - AssertionE... 265s FAILED tests/adapter/test_dataclass.py::test_attrs_field_repr - AssertionErro... 265s FAILED tests/adapter/test_dataclass.py::test_disabled[executing] - TypeError:... 265s FAILED tests/adapter/test_dataclass.py::test_disabled[without-executing] - At... 265s FAILED tests/adapter/test_dataclass.py::test_add_argument - TypeError: CliRun... 265s FAILED tests/adapter/test_dataclass.py::test_remove_positional_argument - ass... 265s FAILED tests/adapter/test_dataclass.py::test_namedtuple - assert {'test_somet... 265s FAILED tests/adapter/test_dataclass.py::test_defaultdict - assert {'test_some... 265s FAILED tests/adapter/test_dataclass.py::test_dataclass_field_repr - assert No... 265s FAILED tests/adapter/test_dataclass.py::test_dataclass_var - assert None == (... 265s FAILED tests/adapter/test_dict.py::test_dict_var - assert None == ('TypeError... 265s FAILED tests/adapter/test_general.py::test_adapter_mismatch - assert None == ... 265s FAILED tests/adapter/test_sequence.py::test_list_adapter_create_inner_snapshot 265s FAILED tests/adapter/test_sequence.py::test_list_adapter_fix_inner_snapshot 265s FAILED tests/adapter/test_sequence.py::test_list_var - assert None == ('TypeE... 265s FAILED tests/test_change.py::test_change_function_args - TypeError: CliRunner... 265s FAILED tests/test_code_repr.py::test_enum - TypeError: CliRunner.__init__() g... 265s FAILED tests/test_code_repr.py::test_snapshot_generates_hasrepr - TypeError: ... 265s FAILED tests/test_code_repr.py::test_enum_in_dataclass - TypeError: CliRunner... 265s FAILED tests/test_code_repr.py::test_flag - TypeError: CliRunner.__init__() g... 265s FAILED tests/test_code_repr.py::test_type - TypeError: CliRunner.__init__() g... 265s FAILED tests/test_code_repr.py::test_qualname - assert None == ('TypeError:\n... 265s FAILED tests/test_code_repr.py::test_invalid_repr - TypeError: CliRunner.__in... 265s FAILED tests/test_config.py::test_config_pyproject - AssertionError: assert {... 265s FAILED tests/test_config.py::test_config_env - AssertionError: assert {'test_... 265s FAILED tests/test_config.py::test_shortcuts - AssertionError: assert {'test_a... 265s FAILED tests/test_config.py::test_default_shortcuts - AssertionError: assert ... 265s FAILED tests/test_dirty_equals.py::test_compare_dirty_equals_twice - assert N... 265s FAILED tests/test_dirty_equals.py::test_dirty_equals_with_changing_args - ass... 265s FAILED tests/test_example.py::test_example - AssertionError: assert [] == ['f... 265s FAILED tests/test_external.py::test_basic - TypeError: CliRunner.__init__() g... 265s FAILED tests/test_external.py::test_persist - TypeError: CliRunner.__init__()... 265s FAILED tests/test_external.py::test_pytest_compare_external - TypeError: CliR... 265s FAILED tests/test_external.py::test_pytest_compare_external_bytes - TypeError... 265s FAILED tests/test_external.py::test_pytest_existing_external_import - TypeErr... 265s FAILED tests/test_external.py::test_pytest_trim_external - TypeError: CliRunn... 265s FAILED tests/test_external.py::test_pytest_new_external - TypeError: CliRunne... 265s FAILED tests/test_external.py::test_pytest_config_hash_length - TypeError: Cl... 265s FAILED tests/test_external.py::test_no_imports - AssertionError: assert {'err... 265s FAILED tests/test_external.py::test_ensure_imports - TypeError: CliRunner.__i... 265s FAILED tests/test_external.py::test_ensure_imports_with_comment - TypeError: ... 265s FAILED tests/test_external.py::test_new_externals - TypeError: CliRunner.__in... 265s FAILED tests/test_formating.py::test_black_formatting_error - assert None == ... 265s FAILED tests/test_formating.py::test_fstring_139 - AssertionError: assert 1 == 0 265s [assert 4 == snapshot()] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 4 == snapshot({})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 4 == snapshot(5)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 4 == snapshot({0: 5})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 4 == snapshot(2+2)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 4 == snapshot({0: 2+2})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 4 <= snapshot()] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 4 <= snapshot({})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 4 <= snapshot(5)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 4 <= snapshot({0: 5})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 5 <= snapshot(4)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 5 <= snapshot({0: 4})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 5 <= snapshot(3+2)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 5 <= snapshot({0: 3+2})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 5 >= snapshot()] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 5 >= snapshot({})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 5 >= snapshot(4)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 5 >= snapshot({0: 4})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 4 >= snapshot(5)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 4 >= snapshot({0: 5})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 5 >= snapshot(3+2)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 5 >= snapshot({0: 3+2})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 5 in snapshot()] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 5 in snapshot({})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 5 in snapshot([4, 5])] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 5 in snapshot({0: [4, 5]})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 5 in snapshot([])] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 5 in snapshot({0: []})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 5 in snapshot([3+2])] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s [assert 5 in snapshot({0: [3+2]})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) fix(==)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) update(==)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) create(<=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) trim(<=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) fix(<=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) update(<=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) create(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) trim(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) fix(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) update(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) create(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) trim(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) fix(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) update(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) update(==)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) create(<=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) trim(<=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) fix(<=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) update(<=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) create(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) trim(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) fix(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) update(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) create(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) trim(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) fix(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) update(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) create(<=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) trim(<=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) fix(<=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) update(<=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) create(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) trim(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) fix(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) update(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) create(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) trim(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) fix(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) update(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) trim(<=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) fix(<=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) update(<=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) create(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) trim(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) fix(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) update(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) create(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) trim(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) fix(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) update(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) fix(<=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) update(<=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) create(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) trim(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) fix(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) update(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) create(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) trim(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) fix(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) update(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) update(<=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) create(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) trim(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) fix(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) update(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) create(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) trim(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) fix(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) update(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) create(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) trim(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) fix(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) update(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) create(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) trim(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) fix(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) update(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) trim(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) fix(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) update(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) create(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) trim(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) fix(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) update(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) fix(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) update(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) create(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) trim(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) fix(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) update(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) update(>=)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) create(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) trim(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) fix(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) update(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(>=) create(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(>=) trim(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(>=) fix(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(>=) update(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(in) trim(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(in) fix(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(in) update(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(in) fix(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(in) update(in)] 265s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(in) update(in)] 265s FAILED tests/test_inline_snapshot.py::test_mutable_values - TypeError: CliRun... 265s FAILED tests/test_inline_snapshot.py::test_comparison - TypeError: CliRunner.... 265s FAILED tests/test_inline_snapshot.py::test_ge - TypeError: CliRunner.__init__... 265s FAILED tests/test_inline_snapshot.py::test_le - TypeError: CliRunner.__init__... 265s FAILED tests/test_inline_snapshot.py::test_contains - TypeError: CliRunner.__... 265s FAILED tests/test_inline_snapshot.py::test_getitem - TypeError: CliRunner.__i... 265s FAILED tests/test_inline_snapshot.py::test_assert - TypeError: CliRunner.__in... 265s FAILED tests/test_inline_snapshot.py::test_format_file - TypeError: CliRunner... 265s FAILED tests/test_inline_snapshot.py::test_format_value - TypeError: CliRunne... 265s FAILED tests/test_inline_snapshot.py::test_type_error - TypeError: CliRunner.... 265s FAILED tests/test_inline_snapshot.py::test_different_snapshot_name - TypeErro... 265s FAILED tests/test_inline_snapshot.py::test_quoting_change_is_no_update - Type... 265s FAILED tests/test_inline_snapshot.py::test_trailing_comma - TypeError: CliRun... 265s FAILED tests/test_inline_snapshot.py::test_is - assert None == ('TypeError:\n... 265s FAILED tests/test_is.py::test_missing_is - TypeError: CliRunner.__init__() go... 265s FAILED tests/test_is_normalized.py::test_repr - assert None == ('TypeError:\n... 265s FAILED tests/test_preserve_values.py::test_fix_list_fix - TypeError: CliRunne... 265s FAILED tests/test_preserve_values.py::test_fix_list_insert - TypeError: CliRu... 265s FAILED tests/test_preserve_values.py::test_fix_list_delete - TypeError: CliRu... 265s FAILED tests/test_preserve_values.py::test_fix_tuple_delete - TypeError: CliR... 265s FAILED tests/test_preserve_values.py::test_fix_dict_change - TypeError: CliRu... 265s FAILED tests/test_preserve_values.py::test_fix_dict_remove - TypeError: CliRu... 265s FAILED tests/test_preserve_values.py::test_fix_dict_insert - TypeError: CliRu... 265s FAILED tests/test_preserve_values.py::test_fix_dict_with_non_literal_keys - T... 265s FAILED tests/test_preserve_values.py::test_no_update_for_dirty_equals - TypeE... 265s FAILED tests/test_preserve_values.py::test_preserve_case_from_original_mr - T... 265s [[5, 5, 5] -> [] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[5, 5] -> [8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 265s [[5, 5, 2+2] -> [4] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[5, 5, 3] -> [3] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[5, 5] -> [8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 265s [[5] -> [8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 265s [[5, 2+2] -> [8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[5, 3] -> [8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[5, 2+2, 5] -> [4] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[5, 2+2] -> [4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[5, 2+2, 2+2] -> [4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[5, 2+2, 3] -> [4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[5, 3, 5] -> [3] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[5, 3] -> [3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[5, 3, 2+2] -> [3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[5, 3, 3] -> [3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[5, 5] -> [8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 265s [[5] -> [8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 265s [[5, 2+2] -> [8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[5, 3] -> [8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[5] -> [8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 265s [[] -> [8, 8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[2+2] -> [8, 8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[3] -> [8, 8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[2+2, 5] -> [8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[2+2] -> [8, 4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[2+2, 2+2] -> [8, 4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[2+2, 3] -> [8, 4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[3, 5] -> [8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[3] -> [8, 3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[3, 2+2] -> [8, 3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[3, 3] -> [8, 3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[2+2, 5, 5] -> [4] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[2+2, 5] -> [4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[2+2, 5, 2+2] -> [4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[2+2, 5, 3] -> [4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[2+2, 5] -> [4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[2+2] -> [4, 8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[2+2, 2+2] -> [4, 8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[2+2, 3] -> [4, 8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[2+2, 2+2, 5] -> [4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[2+2, 2+2] -> [4, 4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[2+2, 2+2, 2+2] -> [4, 4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[2+2, 2+2, 3] -> [4, 4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[2+2, 3, 5] -> [4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[2+2, 3] -> [4, 3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[2+2, 3, 2+2] -> [4, 3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[2+2, 3, 3] -> [4, 3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[3, 5, 5] -> [3] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[3, 5] -> [3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[3, 5, 2+2] -> [3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[3, 5, 3] -> [3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[3, 5] -> [3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[3] -> [3, 8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[3, 2+2] -> [3, 8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[3, 3] -> [3, 8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[3, 2+2, 5] -> [3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[3, 2+2] -> [3, 4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[3, 2+2, 2+2] -> [3, 4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[3, 2+2, 3] -> [3, 4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[3, 3, 5] -> [3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[3, 3] -> [3, 3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [[3, 3, 2+2] -> [3, 3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(5, 5, 5) -> () ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(5, 5) -> (8,) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 265s [(5, 5, 2+2) -> (4,) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(5, 5, 3) -> (3,) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(5, 5) -> (8,) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 265s [(5,) -> (8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 265s [(5, 2+2) -> (8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(5, 3) -> (8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(5, 2+2, 5) -> (4,) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(5, 2+2) -> (4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(5, 2+2, 2+2) -> (4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(5, 2+2, 3) -> (4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(5, 3, 5) -> (3,) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(5, 3) -> (3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(5, 3, 2+2) -> (3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(5, 3, 3) -> (3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(5, 5) -> (8,) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 265s [(5,) -> (8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 265s [(5, 2+2) -> (8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(5, 3) -> (8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(5,) -> (8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 265s [() -> (8, 8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(2+2,) -> (8, 8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(3,) -> (8, 8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(2+2, 5) -> (8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(2+2,) -> (8, 4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(2+2, 2+2) -> (8, 4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(2+2, 3) -> (8, 4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(3, 5) -> (8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(3,) -> (8, 3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(3, 2+2) -> (8, 3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(3, 3) -> (8, 3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(2+2, 5, 5) -> (4,) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(2+2, 5) -> (4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(2+2, 5, 2+2) -> (4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(2+2, 5, 3) -> (4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(2+2, 5) -> (4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(2+2,) -> (4, 8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(2+2, 2+2) -> (4, 8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(2+2, 3) -> (4, 8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(2+2, 2+2, 5) -> (4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(2+2, 2+2) -> (4, 4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(2+2, 2+2, 2+2) -> (4, 4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(2+2, 2+2, 3) -> (4, 4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(2+2, 3, 5) -> (4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(2+2, 3) -> (4, 3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(2+2, 3, 2+2) -> (4, 3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(2+2, 3, 3) -> (4, 3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(3, 5, 5) -> (3,) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(3, 5) -> (3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(3, 5, 2+2) -> (3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(3, 5, 3) -> (3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(3, 5) -> (3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(3,) -> (3, 8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(3, 2+2) -> (3, 8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(3, 3) -> (3, 8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(3, 2+2, 5) -> (3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(3, 2+2) -> (3, 4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(3, 2+2, 2+2) -> (3, 4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(3, 2+2, 3) -> (3, 4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(3, 3, 5) -> (3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(3, 3) -> (3, 3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [(3, 3, 2+2) -> (3, 3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 5, 1: 5, 2: 5} -> {} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 5, 1: 5} -> {2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 5, 1: 5, 2: 2+2} -> {2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 5, 1: 5, 2: 3} -> {2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 5, 2: 5} -> {1: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 5} -> {1: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 5, 2: 2+2} -> {1: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 5, 2: 3} -> {1: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 5, 1: 2+2, 2: 5} -> {1: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 5, 1: 2+2} -> {1: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 5, 1: 2+2, 2: 2+2} -> {1: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 5, 1: 2+2, 2: 3} -> {1: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 5, 1: 3, 2: 5} -> {1: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 5, 1: 3} -> {1: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 5, 1: 3, 2: 2+2} -> {1: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 5, 1: 3, 2: 3} -> {1: 3, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{1: 5, 2: 5} -> {0: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{1: 5} -> {0: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{1: 5, 2: 2+2} -> {0: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{1: 5, 2: 3} -> {0: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{2: 5} -> {0: 8, 1: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{} -> {0: 8, 1: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{2: 2+2} -> {0: 8, 1: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{2: 3} -> {0: 8, 1: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{1: 2+2, 2: 5} -> {0: 8, 1: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{1: 2+2} -> {0: 8, 1: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{1: 2+2, 2: 2+2} -> {0: 8, 1: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{1: 2+2, 2: 3} -> {0: 8, 1: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{1: 3, 2: 5} -> {0: 8, 1: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{1: 3} -> {0: 8, 1: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{1: 3, 2: 2+2} -> {0: 8, 1: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{1: 3, 2: 3} -> {0: 8, 1: 3, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 2+2, 1: 5, 2: 5} -> {0: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 2+2, 1: 5} -> {0: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 2+2, 1: 5, 2: 2+2} -> {0: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 2+2, 1: 5, 2: 3} -> {0: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 2+2, 2: 5} -> {0: 4, 1: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 2+2} -> {0: 4, 1: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 2+2, 2: 2+2} -> {0: 4, 1: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 2+2, 2: 3} -> {0: 4, 1: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 2+2, 1: 2+2, 2: 5} -> {0: 4, 1: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 2+2, 1: 2+2} -> {0: 4, 1: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 2+2, 1: 2+2, 2: 2+2} -> {0: 4, 1: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 2+2, 1: 2+2, 2: 3} -> {0: 4, 1: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 2+2, 1: 3, 2: 5} -> {0: 4, 1: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 2+2, 1: 3} -> {0: 4, 1: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 2+2, 1: 3, 2: 2+2} -> {0: 4, 1: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 2+2, 1: 3, 2: 3} -> {0: 4, 1: 3, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 3, 1: 5, 2: 5} -> {0: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 3, 1: 5} -> {0: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 3, 1: 5, 2: 2+2} -> {0: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 3, 1: 5, 2: 3} -> {0: 3, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 3, 2: 5} -> {0: 3, 1: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 3} -> {0: 3, 1: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 3, 2: 2+2} -> {0: 3, 1: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 3, 2: 3} -> {0: 3, 1: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 3, 1: 2+2, 2: 5} -> {0: 3, 1: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 3, 1: 2+2} -> {0: 3, 1: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 3, 1: 2+2, 2: 2+2} -> {0: 3, 1: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 3, 1: 2+2, 2: 3} -> {0: 3, 1: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 3, 1: 3, 2: 5} -> {0: 3, 1: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 3, 1: 3} -> {0: 3, 1: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s [{0: 3, 1: 3, 2: 2+2} -> {0: 3, 1: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 265s FAILED tests/test_pydantic.py::test_pydantic_create_snapshot - AssertionError... 265s FAILED tests/test_pydantic.py::test_pydantic_field_repr - AssertionError: ass... 265s FAILED tests/test_pydantic.py::test_pydantic_default_value - AssertionError: ... 265s FAILED tests/test_pydantic.py::test_pydantic_factory_method - AssertionError:... 265s FAILED tests/test_pypy.py::test_pypy - TypeError: CliRunner.__init__() got an... 265s FAILED tests/test_pytest_plugin.py::test_create - AssertionError: assert {'er... 265s FAILED tests/test_pytest_plugin.py::test_fix - AssertionError: assert {'error... 265s FAILED tests/test_pytest_plugin.py::test_update - AssertionError: assert {'er... 265s FAILED tests/test_pytest_plugin.py::test_trim - TypeError: CliRunner.__init__... 265s FAILED tests/test_pytest_plugin.py::test_multiple - AssertionError: assert {'... 265s FAILED tests/test_pytest_plugin.py::test_multiple_report - TypeError: CliRunn... 265s FAILED tests/test_pytest_plugin.py::test_black_config - TypeError: CliRunner.... 265s FAILED tests/test_pytest_plugin.py::test_disabled - TypeError: CliRunner.__in... 265s FAILED tests/test_pytest_plugin.py::test_compare - TypeError: CliRunner.__ini... 265s FAILED tests/test_pytest_plugin.py::test_assertion_error_loop - TypeError: Cl... 265s FAILED tests/test_pytest_plugin.py::test_assertion_error - TypeError: CliRunn... 265s FAILED tests/test_pytest_plugin.py::test_pytest_inlinesnapshot_auto - TypeErr... 265s FAILED tests/test_pytest_plugin.py::test_persist_unknown_external - TypeError... 265s FAILED tests/test_pytest_plugin.py::test_diff_multiple_files - TypeError: Cli... 265s FAILED tests/test_pytest_plugin.py::test_storage_dir_config[tests/snapshots] 265s 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 426s autopkgtest [07:03:23]: test autodep8-python3: [----------------------- 426s Testing with python3.12: 427s 427s Testing with python3.13: 427s 427s autopkgtest [07:03:24]: test autodep8-python3: -----------------------] 428s autodep8-python3 PASS (superficial) 428s autopkgtest [07:03:25]: test autodep8-python3: - - - - - - - - - - results - - - - - - - - - - 428s autopkgtest [07:03:25]: @@@@@@@@@@@@@@@@@@@@ summary 428s upstream-tests FAIL non-zero exit status 1 428s autodep8-python3 PASS (superficial) 445s nova [W] Using flock in prodstack6-ppc64el 445s Creating nova instance adt-plucky-ppc64el-python-inline-snapshot-20250219-065617-juju-7f2275-prod-proposed-migration-environment-15-a8645ea4-e655-4bbe-9a27-285319e35bf9 from image adt/ubuntu-plucky-ppc64el-server-20250218.img (UUID 9318aa34-3d3c-43c5-86d2-aaf9390f2f5d)... 445s nova [W] Timed out waiting for 992e98c8-260f-4835-b946-3e6230cc07f8 to get deleted. 445s nova [W] Using flock in prodstack6-ppc64el 445s Creating nova instance adt-plucky-ppc64el-python-inline-snapshot-20250219-065617-juju-7f2275-prod-proposed-migration-environment-15-a8645ea4-e655-4bbe-9a27-285319e35bf9 from image adt/ubuntu-plucky-ppc64el-server-20250218.img (UUID 9318aa34-3d3c-43c5-86d2-aaf9390f2f5d)... 445s nova [W] Timed out waiting for 926d967c-ab38-4776-902d-3e40f188b576 to get deleted.