1s autopkgtest [04:15:49]: starting date and time: 2025-02-19 04:15:49+0000 1s autopkgtest [04:15:49]: git checkout: 325255d2 Merge branch 'pin-any-arch' into 'ubuntu/production' 1s autopkgtest [04:15:49]: host juju-7f2275-prod-proposed-migration-environment-15; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.f5vqj8q2/out --timeout-copy=6000 --setup-commands /home/ubuntu/autopkgtest-cloud/worker-config-production/setup-canonical.sh --apt-pocket=proposed=src:python-click --apt-upgrade python-inline-snapshot --timeout-short=300 --timeout-copy=20000 --timeout-build=20000 --env=ADT_TEST_TRIGGERS=python-click/8.2.0-1 -- ssh -s /home/ubuntu/autopkgtest/ssh-setup/nova -- --flavor autopkgtest --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-15@lcy02-4.secgroup --name adt-plucky-amd64-python-inline-snapshot-20250219-041545-juju-7f2275-prod-proposed-migration-environment-15-0a49f585-6e73-49e4-80ba-346301c7b472 --image adt/ubuntu-plucky-amd64-server --keyname testbed-juju-7f2275-prod-proposed-migration-environment-15 --net-id=net_prod-proposed-migration -e TERM=linux -e ''"'"'http_proxy=http://squid.internal:3128'"'"'' -e ''"'"'https_proxy=http://squid.internal:3128'"'"'' -e ''"'"'no_proxy=127.0.0.1,127.0.1.1,login.ubuntu.com,localhost,localdomain,novalocal,internal,archive.ubuntu.com,ports.ubuntu.com,security.ubuntu.com,ddebs.ubuntu.com,changelogs.ubuntu.com,keyserver.ubuntu.com,launchpadlibrarian.net,launchpadcontent.net,launchpad.net,10.24.0.0/24,keystone.ps5.canonical.com,objectstorage.prodstack5.canonical.com,radosgw.ps5.canonical.com'"'"'' --mirror=http://ftpmaster.internal/ubuntu/ 110s autopkgtest [04:17:38]: testbed dpkg architecture: amd64 110s autopkgtest [04:17:38]: testbed apt version: 2.9.29 110s autopkgtest [04:17:38]: @@@@@@@@@@@@@@@@@@@@ test bed setup 110s autopkgtest [04:17:38]: testbed release detected to be: None 110s autopkgtest [04:17:38]: updating testbed package index (apt update) 111s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed InRelease [110 kB] 111s Hit:2 http://ftpmaster.internal/ubuntu plucky InRelease 111s Hit:3 http://ftpmaster.internal/ubuntu plucky-updates InRelease 111s Hit:4 http://ftpmaster.internal/ubuntu plucky-security InRelease 111s Get:5 http://ftpmaster.internal/ubuntu plucky-proposed/main Sources [79.1 kB] 111s Get:6 http://ftpmaster.internal/ubuntu plucky-proposed/universe Sources [788 kB] 111s Get:7 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse Sources [14.6 kB] 111s Get:8 http://ftpmaster.internal/ubuntu plucky-proposed/restricted Sources [3120 B] 111s Get:9 http://ftpmaster.internal/ubuntu plucky-proposed/main amd64 Packages [106 kB] 111s Get:10 http://ftpmaster.internal/ubuntu plucky-proposed/main i386 Packages [84.0 kB] 111s Get:11 http://ftpmaster.internal/ubuntu plucky-proposed/restricted i386 Packages [2412 B] 111s Get:12 http://ftpmaster.internal/ubuntu plucky-proposed/restricted amd64 Packages [7984 B] 111s Get:13 http://ftpmaster.internal/ubuntu plucky-proposed/universe i386 Packages [271 kB] 111s Get:14 http://ftpmaster.internal/ubuntu plucky-proposed/universe amd64 Packages [712 kB] 111s Get:15 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse i386 Packages [3440 B] 111s Get:16 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse amd64 Packages [12.4 kB] 111s Fetched 2194 kB in 0s (6064 kB/s) 112s Reading package lists... 112s + lsb_release --codename --short 112s + RELEASE=plucky 112s + cat 112s + [ plucky != trusty ] 112s + DEBIAN_FRONTEND=noninteractive eatmydata apt-get -y --allow-downgrades -o Dpkg::Options::=--force-confnew dist-upgrade 112s Reading package lists... 112s Building dependency tree... 112s Reading state information... 112s Calculating upgrade... 113s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 113s + rm /etc/apt/preferences.d/force-downgrade-to-release.pref 113s + /usr/lib/apt/apt-helper analyze-pattern ?true 113s + + uname -r 113s sed s/\./\\./g 113s + running_kernel_pattern=^linux-.*6\.12\.0-15-generic.* 113s + apt list ?obsolete 113s + tail -n+2 113s + grep -v+ cut -d/ -f1 113s ^linux-.*6\.12\.0-15-generic.* 113s + true 113s + obsolete_pkgs= 113s + DEBIAN_FRONTEND=noninteractive eatmydata apt-get -y purge --autoremove 113s Reading package lists... 113s Building dependency tree... 113s 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 + [ x86_64 = ppc64le ] 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 [04:17:42]: upgrading testbed (apt dist-upgrade and autopurge) 114s Reading package lists... 114s Building dependency tree... 114s Reading state information... 114s Calculating upgrade...Starting pkgProblemResolver with broken count: 0 115s Starting 2 pkgProblemResolver with broken count: 0 115s Done 115s Entering ResolveByKeep 115s 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... 116s Starting pkgProblemResolver with broken count: 0 116s Starting 2 pkgProblemResolver with broken count: 0 116s Done 117s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 117s autopkgtest [04:17:45]: testbed running kernel: Linux 6.12.0-15-generic #15-Ubuntu SMP PREEMPT_DYNAMIC Tue Feb 4 16:02:16 UTC 2025 117s autopkgtest [04:17:45]: @@@@@@@@@@@@@@@@@@@@ apt-source python-inline-snapshot 118s Get:1 http://ftpmaster.internal/ubuntu plucky/universe python-inline-snapshot 0.19.3-1 (dsc) [3233 B] 118s Get:2 http://ftpmaster.internal/ubuntu plucky/universe python-inline-snapshot 0.19.3-1 (tar) [87.9 kB] 118s Get:3 http://ftpmaster.internal/ubuntu plucky/universe python-inline-snapshot 0.19.3-1 (diff) [7508 B] 118s gpgv: Signature made Thu Jan 16 17:58:09 2025 UTC 118s gpgv: using RSA key FC875C834BC71FB6546250A86E25BF686AA7D62A 118s gpgv: issuer "katharasasikumar007@gmail.com" 118s gpgv: Can't check signature: No public key 118s dpkg-source: warning: cannot verify inline signature for ./python-inline-snapshot_0.19.3-1.dsc: no acceptable signature found 118s autopkgtest [04:17:46]: testing package python-inline-snapshot version 0.19.3-1 118s autopkgtest [04:17:46]: build not needed 119s autopkgtest [04:17:47]: test upstream-tests: preparing testbed 119s Reading package lists... 119s Building dependency tree... 119s Reading state information... 119s Starting pkgProblemResolver with broken count: 0 119s Starting 2 pkgProblemResolver with broken count: 0 119s Done 120s The following NEW packages will be installed: 120s black python-inline-snapshot-doc python3-all python3-annotated-types 120s python3-asttokens python3-click python3-dateutil python3-dirty-equals 120s python3-dnspython python3-email-validator python3-executing 120s python3-freezegun python3-hypothesis python3-iniconfig 120s python3-inline-snapshot python3-mypy-extensions python3-packaging 120s python3-pathspec python3-platformdirs python3-pluggy python3-pydantic 120s python3-pydantic-core python3-pytest python3-pytest-freezer 120s python3-pytest-mock python3-pytest-subtests python3-sortedcontainers 120s python3-time-machine python3.12 python3.12-minimal 120s 0 upgraded, 30 newly installed, 0 to remove and 0 not upgraded. 120s Need to get 8795 kB of archives. 120s After this operation, 41.2 MB of additional disk space will be used. 120s Get:1 http://ftpmaster.internal/ubuntu plucky/main amd64 python3.12-minimal amd64 3.12.9-1 [2348 kB] 120s Get:2 http://ftpmaster.internal/ubuntu plucky/main amd64 python3.12 amd64 3.12.9-1 [671 kB] 120s Get:3 http://ftpmaster.internal/ubuntu plucky-proposed/main amd64 python3-click all 8.2.0-1 [81.9 kB] 120s Get:4 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-mypy-extensions all 1.0.0-1 [6148 B] 120s Get:5 http://ftpmaster.internal/ubuntu plucky/main amd64 python3-packaging all 24.2-1 [51.5 kB] 120s Get:6 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-pathspec all 0.12.1-1 [24.5 kB] 120s Get:7 http://ftpmaster.internal/ubuntu plucky/main amd64 python3-platformdirs all 4.3.6-1 [16.8 kB] 120s Get:8 http://ftpmaster.internal/ubuntu plucky/universe amd64 black amd64 25.1.0-1 [1802 kB] 120s Get:9 http://ftpmaster.internal/ubuntu plucky/universe amd64 python-inline-snapshot-doc all 0.19.3-1 [541 kB] 120s Get:10 http://ftpmaster.internal/ubuntu plucky/main amd64 python3-all amd64 3.13.1-1~exp2 [894 B] 120s Get:11 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-annotated-types all 0.7.0-1 [19.4 kB] 120s Get:12 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-asttokens all 3.0.0-1 [20.4 kB] 120s Get:13 http://ftpmaster.internal/ubuntu plucky/main amd64 python3-dateutil all 2.9.0-3 [80.2 kB] 120s Get:14 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-dirty-equals all 0.9.0-1 [23.2 kB] 120s Get:15 http://ftpmaster.internal/ubuntu plucky/main amd64 python3-dnspython all 2.7.0-1ubuntu1 [167 kB] 120s Get:16 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-email-validator all 2.2.0-1 [28.5 kB] 120s Get:17 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-executing all 2.2.0-0.1 [25.0 kB] 120s Get:18 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-freezegun all 1.5.1-1.2 [15.9 kB] 120s Get:19 http://ftpmaster.internal/ubuntu plucky/main amd64 python3-sortedcontainers all 2.4.0-2 [27.6 kB] 120s Get:20 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-hypothesis all 6.125.2-1 [333 kB] 120s Get:21 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-iniconfig all 1.1.1-2 [6024 B] 120s Get:22 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-inline-snapshot all 0.19.3-1 [32.5 kB] 120s Get:23 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-pluggy all 1.5.0-1 [21.0 kB] 120s Get:24 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-pydantic-core amd64 2.27.2-1 [1860 kB] 120s Get:25 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-pydantic amd64 2.10.6-1 [288 kB] 120s Get:26 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-pytest all 8.3.4-1 [252 kB] 120s Get:27 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-pytest-freezer all 0.4.9-1 [4542 B] 120s Get:28 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-pytest-mock all 3.14.0-2 [11.7 kB] 120s Get:29 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-pytest-subtests all 0.13.1-1 [10.8 kB] 120s Get:30 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-time-machine amd64 2.16.0-1 [24.7 kB] 120s Fetched 8795 kB in 0s (22.6 MB/s) 120s Selecting previously unselected package python3.12-minimal. 121s (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 ... 108925 files and directories currently installed.) 121s Preparing to unpack .../00-python3.12-minimal_3.12.9-1_amd64.deb ... 121s Unpacking python3.12-minimal (3.12.9-1) ... 121s Selecting previously unselected package python3.12. 121s Preparing to unpack .../01-python3.12_3.12.9-1_amd64.deb ... 121s Unpacking python3.12 (3.12.9-1) ... 121s Selecting previously unselected package python3-click. 121s Preparing to unpack .../02-python3-click_8.2.0-1_all.deb ... 121s Unpacking python3-click (8.2.0-1) ... 121s Selecting previously unselected package python3-mypy-extensions. 121s Preparing to unpack .../03-python3-mypy-extensions_1.0.0-1_all.deb ... 121s Unpacking python3-mypy-extensions (1.0.0-1) ... 121s Selecting previously unselected package python3-packaging. 121s Preparing to unpack .../04-python3-packaging_24.2-1_all.deb ... 121s Unpacking python3-packaging (24.2-1) ... 121s Selecting previously unselected package python3-pathspec. 121s Preparing to unpack .../05-python3-pathspec_0.12.1-1_all.deb ... 121s Unpacking python3-pathspec (0.12.1-1) ... 121s Selecting previously unselected package python3-platformdirs. 121s Preparing to unpack .../06-python3-platformdirs_4.3.6-1_all.deb ... 121s Unpacking python3-platformdirs (4.3.6-1) ... 121s Selecting previously unselected package black. 121s Preparing to unpack .../07-black_25.1.0-1_amd64.deb ... 121s Unpacking black (25.1.0-1) ... 121s Selecting previously unselected package python-inline-snapshot-doc. 121s Preparing to unpack .../08-python-inline-snapshot-doc_0.19.3-1_all.deb ... 121s Unpacking python-inline-snapshot-doc (0.19.3-1) ... 121s Selecting previously unselected package python3-all. 121s Preparing to unpack .../09-python3-all_3.13.1-1~exp2_amd64.deb ... 121s Unpacking python3-all (3.13.1-1~exp2) ... 121s Selecting previously unselected package python3-annotated-types. 121s Preparing to unpack .../10-python3-annotated-types_0.7.0-1_all.deb ... 121s Unpacking python3-annotated-types (0.7.0-1) ... 121s Selecting previously unselected package python3-asttokens. 121s Preparing to unpack .../11-python3-asttokens_3.0.0-1_all.deb ... 121s Unpacking python3-asttokens (3.0.0-1) ... 121s Selecting previously unselected package python3-dateutil. 121s Preparing to unpack .../12-python3-dateutil_2.9.0-3_all.deb ... 121s Unpacking python3-dateutil (2.9.0-3) ... 121s Selecting previously unselected package python3-dirty-equals. 121s Preparing to unpack .../13-python3-dirty-equals_0.9.0-1_all.deb ... 121s Unpacking python3-dirty-equals (0.9.0-1) ... 121s Selecting previously unselected package python3-dnspython. 121s Preparing to unpack .../14-python3-dnspython_2.7.0-1ubuntu1_all.deb ... 121s Unpacking python3-dnspython (2.7.0-1ubuntu1) ... 121s Selecting previously unselected package python3-email-validator. 121s Preparing to unpack .../15-python3-email-validator_2.2.0-1_all.deb ... 121s Unpacking python3-email-validator (2.2.0-1) ... 121s Selecting previously unselected package python3-executing. 121s Preparing to unpack .../16-python3-executing_2.2.0-0.1_all.deb ... 121s Unpacking python3-executing (2.2.0-0.1) ... 121s Selecting previously unselected package python3-freezegun. 121s Preparing to unpack .../17-python3-freezegun_1.5.1-1.2_all.deb ... 121s Unpacking python3-freezegun (1.5.1-1.2) ... 121s Selecting previously unselected package python3-sortedcontainers. 121s Preparing to unpack .../18-python3-sortedcontainers_2.4.0-2_all.deb ... 121s Unpacking python3-sortedcontainers (2.4.0-2) ... 121s Selecting previously unselected package python3-hypothesis. 121s Preparing to unpack .../19-python3-hypothesis_6.125.2-1_all.deb ... 121s Unpacking python3-hypothesis (6.125.2-1) ... 121s Selecting previously unselected package python3-iniconfig. 122s Preparing to unpack .../20-python3-iniconfig_1.1.1-2_all.deb ... 122s Unpacking python3-iniconfig (1.1.1-2) ... 122s Selecting previously unselected package python3-inline-snapshot. 122s Preparing to unpack .../21-python3-inline-snapshot_0.19.3-1_all.deb ... 122s Unpacking python3-inline-snapshot (0.19.3-1) ... 122s Selecting previously unselected package python3-pluggy. 122s Preparing to unpack .../22-python3-pluggy_1.5.0-1_all.deb ... 122s Unpacking python3-pluggy (1.5.0-1) ... 122s Selecting previously unselected package python3-pydantic-core. 122s Preparing to unpack .../23-python3-pydantic-core_2.27.2-1_amd64.deb ... 122s Unpacking python3-pydantic-core (2.27.2-1) ... 122s Selecting previously unselected package python3-pydantic. 122s Preparing to unpack .../24-python3-pydantic_2.10.6-1_amd64.deb ... 122s Unpacking python3-pydantic (2.10.6-1) ... 122s Selecting previously unselected package python3-pytest. 122s Preparing to unpack .../25-python3-pytest_8.3.4-1_all.deb ... 122s Unpacking python3-pytest (8.3.4-1) ... 122s Selecting previously unselected package python3-pytest-freezer. 122s Preparing to unpack .../26-python3-pytest-freezer_0.4.9-1_all.deb ... 122s Unpacking python3-pytest-freezer (0.4.9-1) ... 122s Selecting previously unselected package python3-pytest-mock. 122s Preparing to unpack .../27-python3-pytest-mock_3.14.0-2_all.deb ... 122s Unpacking python3-pytest-mock (3.14.0-2) ... 122s Selecting previously unselected package python3-pytest-subtests. 122s Preparing to unpack .../28-python3-pytest-subtests_0.13.1-1_all.deb ... 122s Unpacking python3-pytest-subtests (0.13.1-1) ... 122s Selecting previously unselected package python3-time-machine. 122s Preparing to unpack .../29-python3-time-machine_2.16.0-1_amd64.deb ... 122s Unpacking python3-time-machine (2.16.0-1) ... 122s Setting up python3-iniconfig (1.1.1-2) ... 122s Setting up python3.12-minimal (3.12.9-1) ... 123s Setting up python3-pydantic-core (2.27.2-1) ... 123s Setting up python3-asttokens (3.0.0-1) ... 123s Setting up python3-mypy-extensions (1.0.0-1) ... 123s Setting up python3.12 (3.12.9-1) ... 124s Setting up python3-dirty-equals (0.9.0-1) ... 125s Setting up python3-all (3.13.1-1~exp2) ... 125s Setting up python3-sortedcontainers (2.4.0-2) ... 125s Setting up python3-click (8.2.0-1) ... 125s Setting up python3-annotated-types (0.7.0-1) ... 125s Setting up python3-platformdirs (4.3.6-1) ... 125s Setting up python3-packaging (24.2-1) ... 126s Setting up python3-executing (2.2.0-0.1) ... 126s Setting up python3-pluggy (1.5.0-1) ... 126s Setting up python3-dnspython (2.7.0-1ubuntu1) ... 127s Setting up python3-dateutil (2.9.0-3) ... 127s Setting up python3-email-validator (2.2.0-1) ... 127s Setting up python-inline-snapshot-doc (0.19.3-1) ... 127s Setting up python3-pathspec (0.12.1-1) ... 127s Setting up python3-freezegun (1.5.1-1.2) ... 127s Setting up python3-pytest (8.3.4-1) ... 128s Setting up python3-hypothesis (6.125.2-1) ... 129s Setting up black (25.1.0-1) ... 129s Setting up python3-time-machine (2.16.0-1) ... 129s Setting up python3-inline-snapshot (0.19.3-1) ... 129s Setting up python3-pydantic (2.10.6-1) ... 130s Setting up python3-pytest-freezer (0.4.9-1) ... 130s Setting up python3-pytest-mock (3.14.0-2) ... 130s Setting up python3-pytest-subtests (0.13.1-1) ... 130s Processing triggers for man-db (2.13.0-1) ... 131s Processing triggers for systemd (257.2-3ubuntu1) ... 131s autopkgtest [04:17:59]: test upstream-tests: [----------------------- 131s 131s *************************** 131s *** Testing with python3.12 131s *************************** 131s 131s Content of current working folder: 131s 131s total 12 131s drwxr-xr-x 3 ubuntu ubuntu 4096 Feb 19 04:17 . 131s drwxrwxrwt 5 root root 4096 Feb 19 04:17 .. 131s drwxrwxr-x 3 ubuntu ubuntu 4096 Jan 15 18:43 tests 131s Running tests... 131s 133s ============================= test session starts ============================== 133s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 133s rootdir: /tmp/autopkgtest.WzbXtF/autopkgtest_tmp 133s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 133s collected 392 items / 10 deselected / 382 selected 133s 139s tests/adapter/test_dataclass.py FFFFEFE.FF.F.FEFEFEFF [ 4%] 139s tests/adapter/test_dict.py F [ 4%] 140s tests/adapter/test_general.py F. [ 4%] 140s tests/adapter/test_sequence.py FF..F [ 6%] 140s tests/test_align.py . [ 6%] 140s tests/test_change.py F [ 6%] 141s tests/test_code_repr.py FF.FFFF.............................F [ 16%] 144s tests/test_config.py FEFEFEFE [ 17%] 144s tests/test_dirty_equals.py xF..F [ 18%] 145s tests/test_docs.py .s [ 19%] 145s tests/test_example.py FE [ 19%] 154s tests/test_external.py F..FFFFFFF..FFFF [ 23%] 156s tests/test_formating.py FF.. [ 24%] 156s tests/test_fstring.py .. [ 25%] 156s tests/test_hasrepr.py . [ 25%] 157s tests/test_inline_snapshot.py ..uuuuuuuuuuuuuuuuuuuuuuuuuuuuuu.,,,,,,,,, [ 26%] 159s ,,,,,,,,,,,,,,,,,,,,,.FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 39%] 161s FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF,,.,,.,,,.,,.,,., [ 55%] 162s ,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,, [ 61%] 162s .,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,. [ 67%] 162s ,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,.,, [ 73%] 162s ,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,,.,,. [ 79%] 163s ,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,.FFFFFFF...FF.FFFF..F [ 86%] 163s tests/test_is.py F [ 87%] 163s tests/test_is_normalized.py F [ 87%] 164s tests/test_preserve_values.py FFFFFFFFFFuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu [ 90%] 167s uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu,uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu [ 90%] 169s uuuuuuuuuuuuuuuuuuuuuuu,uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu [ 90%] 170s uuuuuuuuuuuuuuu,. [ 90%] 174s tests/test_pydantic.py FEFEFE.FE [ 91%] 175s tests/test_pypy.py F [ 91%] 193s tests/test_pytest_plugin.py .FFFFF.FFFFF.F.FFF..FFFE [ 97%] 193s tests/test_raises.py . [ 98%] 193s tests/test_rewrite_code.py .F [ 98%] 195s tests/test_string.py FFF. [ 99%] 195s tests/test_warns.py . [100%] 195s 195s ==================================== ERRORS ==================================== 195s ________________ ERROR at teardown of test_attrs_default_value _________________ 195s some snapshots in this test have incorrect values. 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot,Is 195s import attrs 195s 195s @attrs.define 195s class A: 195s a:int 195s b:int=2 195s c:list=attrs.field(factory=list) 195s d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) 195s 195s def test_something(): 195s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 195s assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) 195s 195s 195s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmpws4co2b3 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_something.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ________________________________ test_something ________________________________ 195s 195s def test_something(): 195s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 195s > assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) 195s 195s test_something.py:13: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:194: in assign 195s result_kwargs[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '2 ', filename = PosixPath('/tmp/tmpws4co2b3/test_something.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_something.py::test_something - TypeError: CliRunner.__init__() go... 195s ============================== 1 failed in 0.20s =============================== 195s 195s stderr: 195s 195s __________________ ERROR at teardown of test_attrs_field_repr __________________ 195s some snapshots in this test have incorrect values. 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot 195s import attrs 195s 195s @attrs.define 195s class container: 195s a: int 195s b: int = attrs.field(default=5,repr=False) 195s 195s assert container(a=1,b=5) == snapshot() 195s 195s 195s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmpxler1x2t 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 0 items / 1 error 195s 195s ==================================== ERRORS ==================================== 195s ______________________ ERROR collecting test_something.py ______________________ 195s test_something.py:9: in 195s assert container(a=1,b=5) == snapshot() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 195s runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s ERROR test_something.py - TypeError: CliRunner.__init__() got an unexpected k... 195s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 195s =============================== 1 error in 0.28s =============================== 195s 195s stderr: 195s 195s _____________ ERROR at teardown of test_remove_positional_argument _____________ 195s some snapshots in this test have incorrect values. 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot 195s 195s from inline_snapshot._adapter.generic_call_adapter import GenericCallAdapter,Argument 195s 195s 195s class L: 195s def __init__(self,*l): 195s self.l=l 195s 195s def __eq__(self,other): 195s if not isinstance(other,L): 195s return NotImplemented 195s return other.l==self.l 195s 195s class LAdapter(GenericCallAdapter): 195s @classmethod 195s def check_type(cls, typ): 195s return issubclass(typ,L) 195s 195s @classmethod 195s def arguments(cls, value): 195s return ([Argument(x) for x in value.l],{}) 195s 195s @classmethod 195s def argument(cls, value, pos_or_name): 195s assert isinstance(pos_or_name,int) 195s return value.l[pos_or_name] 195s 195s def test_L1(): 195s assert L(1,2) == snapshot(L(1)), "not equal" 195s 195s def test_L2(): 195s assert L(1,2) == snapshot(L(1, 2, 3)), "not equal" 195s 195s 195s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmp_5uybdhy 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 2 items 195s 195s test_something.py F. [100%] 195s 195s =================================== FAILURES =================================== 195s ___________________________________ test_L1 ____________________________________ 195s 195s def test_L1(): 195s > assert L(1,2) == snapshot(L(1)), "not equal" 195s 195s test_something.py:30: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:162: in assign 195s new_code=self.context.file._value_to_code(value.value), 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '2 ', filename = PosixPath('/tmp/tmp_5uybdhy/test_something.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s ──────────────────────────────── Fix snapshots ───────────────────────────────── 195s =========================== short test summary info ============================ 195s FAILED test_something.py::test_L1 - TypeError: CliRunner.__init__() got an un... 195s 195s stderr: 195s Traceback (most recent call last): 195s File "", line 198, in _run_module_as_main 195s File "", line 88, in _run_code 195s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 195s raise SystemExit(pytest.console_main()) 195s ^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 195s code = main() 195s ^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 195s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 195s return wrap_session(config, _main) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 195s config.hook.pytest_sessionfinish( 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 195s teardown.send(result) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 195s self.config.hook.pytest_terminal_summary( 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary 195s diff = file.diff() 195s ^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff 195s unified_diff(self.source.splitlines(), self.new_code().splitlines()), 195s ^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s ^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s _____________________ ERROR at teardown of test_namedtuple _____________________ 195s some snapshots in this test have incorrect values. 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot 195s from collections import namedtuple 195s 195s T=namedtuple("T","a,b") 195s 195s def test_tuple(): 195s assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" 195s 195s 195s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmp3k1f4dv_ 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_something.py F [100%] 195s 195s =================================== FAILURES =================================== 195s __________________________________ test_tuple __________________________________ 195s 195s def test_tuple(): 195s > assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" 195s 195s test_something.py:7: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:194: in assign 195s result_kwargs[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '2 ', filename = PosixPath('/tmp/tmp3k1f4dv_/test_something.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_something.py::test_tuple - TypeError: CliRunner.__init__() got an... 195s ============================== 1 failed in 0.22s =============================== 195s 195s stderr: 195s 195s ____________________ ERROR at teardown of test_defaultdict _____________________ 195s some snapshots in this test have incorrect values. 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot 195s from collections import defaultdict 195s 195s 195s def test_tuple(): 195s d=defaultdict(list) 195s d[1].append(2) 195s assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" 195s 195s 195s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmpi6u0thmg 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_something.py F [100%] 195s 195s =================================== FAILURES =================================== 195s __________________________________ test_tuple __________________________________ 195s 195s def test_tuple(): 195s d=defaultdict(list) 195s d[1].append(2) 195s > assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" 195s 195s test_something.py:8: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:140: in assign 195s result = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '2 ', filename = PosixPath('/tmp/tmpi6u0thmg/test_something.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_something.py::test_tuple - TypeError: CliRunner.__init__() got an... 195s ============================== 1 failed in 0.20s =============================== 195s 195s stderr: 195s 195s __________________ ERROR at teardown of test_config_pyproject __________________ 195s some snapshots in this test have incorrect values. 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_a.py 195s from inline_snapshot import snapshot 195s 195s def test_a(): 195s assert 1 <= snapshot(5) 195s assert 1 == snapshot(2) 195s 195s 195s file: pyproject.toml 195s 195s [tool.inline-snapshot] 195s default-flags = ["trim"] 195s 195s 195s run> /usr/bin/python3.12 -m pytest 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmpm5c6bh6d 195s configfile: pyproject.toml 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_a.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s assert 1 <= snapshot(5) 195s > assert 1 == snapshot(2) 195s 195s test_a.py:5: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '1 ', filename = PosixPath('/tmp/tmpm5c6bh6d/test_a.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 195s 195s stderr: 195s Traceback (most recent call last): 195s File "", line 198, in _run_module_as_main 195s File "", line 88, in _run_code 195s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 195s raise SystemExit(pytest.console_main()) 195s ^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 195s code = main() 195s ^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 195s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 195s return wrap_session(config, _main) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 195s config.hook.pytest_sessionfinish( 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 195s teardown.send(result) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 195s self.config.hook.pytest_terminal_summary( 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 195s for change in snapshot._changes(): 195s ^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 195s yield from self._value._get_changes() 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s _____________________ ERROR at teardown of test_config_env _____________________ 195s some snapshots in this test have incorrect values. 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_a.py 195s from inline_snapshot import snapshot 195s 195s def test_a(): 195s assert 1 <= snapshot(5) 195s assert 1 == snapshot(2) 195s 195s 195s run> /usr/bin/python3.12 -m pytest 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmppdxsfewu 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_a.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s assert 1 <= snapshot(5) 195s > assert 1 == snapshot(2) 195s 195s test_a.py:5: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '1 ', filename = PosixPath('/tmp/tmppdxsfewu/test_a.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 195s 195s stderr: 195s Traceback (most recent call last): 195s File "", line 198, in _run_module_as_main 195s File "", line 88, in _run_code 195s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 195s raise SystemExit(pytest.console_main()) 195s ^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 195s code = main() 195s ^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 195s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 195s return wrap_session(config, _main) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 195s config.hook.pytest_sessionfinish( 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 195s teardown.send(result) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 195s self.config.hook.pytest_terminal_summary( 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 195s for change in snapshot._changes(): 195s ^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 195s yield from self._value._get_changes() 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s _____________________ ERROR at teardown of test_shortcuts ______________________ 195s some snapshots in this test have incorrect values. 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_a.py 195s from inline_snapshot import snapshot 195s 195s def test_a(): 195s assert 1 <= snapshot(5) 195s assert 1 == snapshot(2) 195s 195s 195s file: pyproject.toml 195s 195s [tool.inline-snapshot.shortcuts] 195s strim=["trim"] 195s 195s 195s run> /usr/bin/python3.12 -m pytest --strim 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmpf9gc3rq9 195s configfile: pyproject.toml 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_a.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s assert 1 <= snapshot(5) 195s > assert 1 == snapshot(2) 195s 195s test_a.py:5: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '1 ', filename = PosixPath('/tmp/tmpf9gc3rq9/test_a.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 195s 195s stderr: 195s Traceback (most recent call last): 195s File "", line 198, in _run_module_as_main 195s File "", line 88, in _run_code 195s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 195s raise SystemExit(pytest.console_main()) 195s ^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 195s code = main() 195s ^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 195s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 195s return wrap_session(config, _main) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 195s config.hook.pytest_sessionfinish( 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 195s teardown.send(result) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 195s self.config.hook.pytest_terminal_summary( 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 195s for change in snapshot._changes(): 195s ^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 195s yield from self._value._get_changes() 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s _________________ ERROR at teardown of test_default_shortcuts __________________ 195s some snapshots in this test have incorrect values. 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_a.py 195s from inline_snapshot import snapshot 195s 195s def test_a(): 195s assert 1 <= snapshot(5) 195s assert 1 == snapshot(2) 195s 195s 195s file: pyproject.toml 195s 195s 195s 195s run> /usr/bin/python3.12 -m pytest --fix 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmp9f_95g15 195s configfile: pyproject.toml 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_a.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s assert 1 <= snapshot(5) 195s > assert 1 == snapshot(2) 195s 195s test_a.py:5: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '1 ', filename = PosixPath('/tmp/tmp9f_95g15/test_a.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 195s 195s stderr: 195s Traceback (most recent call last): 195s File "", line 198, in _run_module_as_main 195s File "", line 88, in _run_code 195s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 195s raise SystemExit(pytest.console_main()) 195s ^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 195s code = main() 195s ^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 195s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 195s return wrap_session(config, _main) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 195s config.hook.pytest_sessionfinish( 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 195s teardown.send(result) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 195s self.config.hook.pytest_terminal_summary( 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 195s for change in snapshot._changes(): 195s ^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 195s yield from self._value._get_changes() 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s ______________________ ERROR at teardown of test_example _______________________ 195s some snapshots in this test have incorrect values. 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_a.py 195s 195s from inline_snapshot import snapshot 195s 195s def test_a(): 195s assert 1==snapshot(2) 195s 195s 195s file: test_b.py 195s 1+1 195s 195s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create,fix 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmp7x5hejg3 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_a.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s > assert 1==snapshot(2) 195s 195s test_a.py:5: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '1 ', filename = PosixPath('/tmp/tmp7x5hejg3/test_a.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 195s ============================== 1 failed in 0.22s =============================== 195s 195s stderr: 195s 195s file: test_b.py 195s 1+1 195s 195s file: test_a.py 195s 195s from inline_snapshot import snapshot 195s 195s def test_a(): 195s assert 1==snapshot(2) 195s 195s 195s run> pytest /tmp/tmpe8mcu2hw/test_b.py 195s run> pytest /tmp/tmpe8mcu2hw/test_a.py 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 195s v() 195s File "/tmp/tmpe8mcu2hw/test_a.py", line 5, in test_a 195s assert 1==snapshot(2) 195s ^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 195s return self == other 195s ^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 195s self._changes.append(next(it)) 195s ^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 195s new_code = self.context.file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s ______________ ERROR at teardown of test_pydantic_create_snapshot ______________ 195s some snapshots in this test have incorrect values. 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s 195s from pydantic import BaseModel 195s from inline_snapshot import snapshot 195s 195s class M(BaseModel): 195s size:int 195s name:str 195s age:int=4 195s 195s def test_pydantic(): 195s m=M(size=5,name="Tom") 195s assert m==snapshot() 195s assert m.dict()==snapshot() 195s 195s 195s 195s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmp4g0tu4rb 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_something.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ________________________________ test_pydantic _________________________________ 195s 195s def test_pydantic(): 195s m=M(size=5,name="Tom") 195s > assert m==snapshot() 195s 195s test_something.py:12: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '', filename = PosixPath('/tmp/tmp4g0tu4rb/test_something.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_something.py::test_pydantic - TypeError: CliRunner.__init__() got... 195s ============================== 1 failed in 0.27s =============================== 195s 195s stderr: 195s 195s ________________ ERROR at teardown of test_pydantic_field_repr _________________ 195s some snapshots in this test have incorrect values. 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot 195s from pydantic import BaseModel,Field 195s 195s class container(BaseModel): 195s a: int 195s b: int = Field(default=5,repr=False) 195s 195s assert container(a=1,b=5) == snapshot() 195s 195s 195s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmp41eyxcos 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 0 items / 1 error 195s 195s ==================================== ERRORS ==================================== 195s ______________________ ERROR collecting test_something.py ______________________ 195s test_something.py:8: in 195s assert container(a=1,b=5) == snapshot() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 195s runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s ERROR test_something.py - TypeError: CliRunner.__init__() got an unexpected k... 195s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 195s =============================== 1 error in 0.33s =============================== 195s 195s stderr: 195s 195s _______________ ERROR at teardown of test_pydantic_default_value _______________ 195s some snapshots in this test have incorrect values. 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot,Is 195s from dataclasses import dataclass,field 195s from pydantic import BaseModel,Field 195s 195s class A(BaseModel): 195s a:int 195s b:int=2 195s c:list=Field(default_factory=list) 195s 195s def test_something(): 195s assert A(a=1) == snapshot(A(a=1,b=2,c=[])) 195s 195s 195s run> /usr/bin/python3.12 -m pytest --inline-snapshot=update 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmpi_bts43r 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_something.py . [100%] 195s =============================== inline snapshot ================================ 195s ─────────────────────────────── Update snapshots ─────────────────────────────── 195s 195s stderr: 195s Traceback (most recent call last): 195s File "", line 198, in _run_module_as_main 195s File "", line 88, in _run_code 195s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 195s raise SystemExit(pytest.console_main()) 195s ^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 195s code = main() 195s ^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 195s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 195s return wrap_session(config, _main) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 195s config.hook.pytest_sessionfinish( 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 195s teardown.send(result) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 195s self.config.hook.pytest_terminal_summary( 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary 195s diff = file.diff() 195s ^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff 195s unified_diff(self.source.splitlines(), self.new_code().splitlines()), 195s ^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s ^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s ______________ ERROR at teardown of test_pydantic_factory_method _______________ 195s some snapshots in this test have incorrect values. 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot 195s from pydantic import BaseModel 195s 195s class A(BaseModel): 195s a:int 195s 195s @classmethod 195s def from_str(cls,s): 195s return cls(a=int(s)) 195s 195s def test_something(): 195s for a in [1,2]: 195s assert A(a=2) == snapshot(A.from_str("1")) 195s 195s 195s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmp9oadt1fw 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_something.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ________________________________ test_something ________________________________ 195s 195s def test_something(): 195s for a in [1,2]: 195s > assert A(a=2) == snapshot(A.from_str("1")) 195s 195s test_something.py:13: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:107: in assign 195s result = yield from self.value_assign(old_value, old_node, new_value) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py:87: in value_assign 195s result = yield from adapter.assign(old_value, old_node, new_value) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = 'A (a =2 )', filename = PosixPath('/tmp/tmp9oadt1fw/test_something.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_something.py::test_something - TypeError: CliRunner.__init__() go... 195s ============================== 1 failed in 0.26s =============================== 195s 195s stderr: 195s 195s ________ ERROR at teardown of test_find_pyproject_in_parent_directories ________ 195s some snapshots in this test have incorrect values. 195s ----------------------------- Captured stdout call ----------------------------- 195s file: pyproject.toml 195s [tool.inline-snapshot] 195s hash-length=2 195s 195s 195s file: project/pytest.ini 195s 195s 195s file: project/test_something.py 195s from inline_snapshot import outsource,snapshot,external 195s 195s def test_something(): 195s assert outsource("test") == snapshot() 195s 195s 195s run> /usr/bin/python3.12 -m pytest --rootdir ./project --inline-snapshot=create 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmpmdei5evw/project 195s configfile: ../pyproject.toml 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s project/test_something.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ________________________________ test_something ________________________________ 195s 195s def test_something(): 195s > assert outsource("test") == snapshot() 195s 195s project/test_something.py:4: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '', filename = PosixPath('/tmp/tmpmdei5evw/project/test_something.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED project/test_something.py::test_something - TypeError: CliRunner.__ini... 195s ============================== 1 failed in 0.20s =============================== 195s 195s stderr: 195s 195s =================================== FAILURES =================================== 195s ________________________________ test_unmanaged ________________________________ 195s 195s def test_unmanaged(): 195s 195s Example( 195s """\ 195s from inline_snapshot import snapshot,Is 195s from dataclasses import dataclass 195s 195s @dataclass 195s class A: 195s a:int 195s b:int 195s 195s def test_something(): 195s assert A(a=2,b=4) == snapshot(A(a=1,b=Is(1))), "not equal" 195s """ 195s > ).run_inline( 195s ["--inline-snapshot=fix"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s from inline_snapshot import snapshot,Is 195s from dataclasses import dataclass 195s 195s @dataclass 195s class A: 195s a:int 195s b:int 195s 195s def test_something(): 195s assert A(a=2,b=4) == snapshot(A(a=2,b=Is(1))), "not equal" 195s """ 195s } 195s ), 195s raises=snapshot( 195s """\ 195s AssertionError: 195s not equal\ 195s """ 195s ), 195s ) 195s 195s tests/adapter/test_dataclass.py:21: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 195s assert raises == f"{type(raised_exception).__name__}:\n" + str( 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 195s filename = PosixPath('/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/adapter/test_dataclass.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot,Is 195s from dataclasses import dataclass 195s 195s @dataclass 195s class A: 195s a:int 195s b:int 195s 195s def test_something(): 195s assert A(a=2,b=4) == snapshot(A(a=1,b=Is(1))), "not equal" 195s 195s 195s run> pytest /tmp/tmpbpev5bew/test_something.py 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 195s v() 195s File "/tmp/tmpbpev5bew/test_something.py", line 10, in test_something 195s assert A(a=2,b=4) == snapshot(A(a=1,b=Is(1))), "not equal" 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 195s return self == other 195s ^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 195s self._changes.append(next(it)) 195s ^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 194, in assign 195s result_kwargs[key] = yield from self.get_adapter( 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 195s new_code = self.context.file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s _________________________________ test_reeval __________________________________ 195s 195s def test_reeval(): 195s Example( 195s """\ 195s from inline_snapshot import snapshot,Is 195s from dataclasses import dataclass 195s 195s @dataclass 195s class A: 195s a:int 195s b:int 195s 195s def test_something(): 195s for c in "ab": 195s assert A(a=1,b=c) == snapshot(A(a=2,b=Is(c))) 195s """ 195s > ).run_inline( 195s ["--inline-snapshot=fix"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s from inline_snapshot import snapshot,Is 195s from dataclasses import dataclass 195s 195s @dataclass 195s class A: 195s a:int 195s b:int 195s 195s def test_something(): 195s for c in "ab": 195s assert A(a=1,b=c) == snapshot(A(a=1,b=Is(c))) 195s """ 195s } 195s ), 195s ) 195s 195s tests/adapter/test_dataclass.py:63: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = ['--inline-snapshot=fix'] 195s 195s def run_inline( 195s self, 195s args: list[str] = [], 195s *, 195s reported_categories: Snapshot[list[Category]] | None = None, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s raises: Snapshot[str] | None = None, 195s ) -> Example: 195s """Execute the example files in process and run every `test_*` 195s function. 195s 195s This is useful for fast test execution. 195s 195s Parameters: 195s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 195s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 195s changed_files: snapshot of files which are changed by this run. 195s raises: snapshot of the exception which is raised during the test execution. 195s It is required if your code raises an exception. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s parser = ArgumentParser() 195s 195s parser.add_argument( 195s "--inline-snapshot", 195s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 195s dest="inline_snapshot", 195s help="update specific snapshot values:\n" 195s "disable: disable the snapshot logic\n" 195s "short-report: show a short report\n" 195s "report: show a longer report with a diff report\n" 195s "review: allow to approve the changes interactive\n" 195s "create: creates snapshots which are currently not defined\n" 195s "update: update snapshots even if they are defined\n" 195s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 195s "fix: change snapshots which currently break your tests\n", 195s ) 195s parsed_args = parser.parse_args(args) 195s flags = (parsed_args.inline_snapshot or "").split(",") 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s 195s self._write_files(tmp_path) 195s 195s raised_exception = None 195s with snapshot_env(): 195s with ChangeRecorder().activate() as recorder: 195s _inline_snapshot._update_flags = Flags({*flags}) 195s inline_snapshot._external.storage = ( 195s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 195s ) 195s 195s try: 195s for filename in tmp_path.glob("*.py"): 195s globals: dict[str, Any] = {} 195s print("run> pytest", filename) 195s exec( 195s compile(filename.read_text("utf-8"), filename, "exec"), 195s globals, 195s ) 195s 195s # run all test_* functions 195s for k, v in globals.items(): 195s if k.startswith("test_") and callable(v): 195s v() 195s except Exception as e: 195s traceback.print_exc() 195s raised_exception = e 195s 195s finally: 195s _inline_snapshot._active = False 195s 195s changes = [] 195s for snapshot in _inline_snapshot.snapshots.values(): 195s changes += snapshot._changes() 195s 195s snapshot_flags = {change.flag for change in changes} 195s 195s apply_all( 195s [ 195s change 195s for change in changes 195s if change.flag in _inline_snapshot._update_flags.to_set() 195s ] 195s ) 195s recorder.fix_all() 195s 195s report_output = StringIO() 195s console = Console(file=report_output) 195s 195s # TODO: add all the report output here 195s report_problems(console) 195s 195s if reported_categories is not None: 195s assert sorted(snapshot_flags) == reported_categories 195s 195s if raised_exception is not None: 195s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 195s raised_exception 195s ) 195s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 195s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot,Is 195s from dataclasses import dataclass 195s 195s @dataclass 195s class A: 195s a:int 195s b:int 195s 195s def test_something(): 195s for c in "ab": 195s assert A(a=1,b=c) == snapshot(A(a=2,b=Is(c))) 195s 195s 195s run> pytest /tmp/tmp988374g3/test_something.py 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 195s v() 195s File "/tmp/tmp988374g3/test_something.py", line 11, in test_something 195s assert A(a=1,b=c) == snapshot(A(a=2,b=Is(c))) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 195s return self == other 195s ^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 195s self._changes.append(next(it)) 195s ^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 194, in assign 195s result_kwargs[key] = yield from self.get_adapter( 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 195s new_code = self.context.file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s _________________________ test_dataclass_default_value _________________________ 195s 195s def test_dataclass_default_value(): 195s Example( 195s """\ 195s from inline_snapshot import snapshot,Is 195s from dataclasses import dataclass,field 195s 195s @dataclass 195s class A: 195s a:int 195s b:int=2 195s c:list=field(default_factory=list) 195s 195s def test_something(): 195s assert A(a=1) == snapshot(A(a=1,b=2,c=[])) 195s """ 195s > ).run_inline( 195s ["--inline-snapshot=update"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s from inline_snapshot import snapshot,Is 195s from dataclasses import dataclass,field 195s 195s @dataclass 195s class A: 195s a:int 195s b:int=2 195s c:list=field(default_factory=list) 195s 195s def test_something(): 195s assert A(a=1) == snapshot(A(a=1)) 195s """ 195s } 195s ), 195s ) 195s 195s tests/adapter/test_dataclass.py:100: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:214: in run_inline 195s recorder.fix_all() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 195s file.rewrite() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 195s new_code = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s 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' 195s filename = PosixPath('/tmp/tmpquxfe_ha/test_something.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot,Is 195s from dataclasses import dataclass,field 195s 195s @dataclass 195s class A: 195s a:int 195s b:int=2 195s c:list=field(default_factory=list) 195s 195s def test_something(): 195s assert A(a=1) == snapshot(A(a=1,b=2,c=[])) 195s 195s 195s run> pytest /tmp/tmpquxfe_ha/test_something.py 195s ___________________________ test_attrs_default_value ___________________________ 195s 195s def test_attrs_default_value(): 195s Example( 195s """\ 195s from inline_snapshot import snapshot,Is 195s import attrs 195s 195s @attrs.define 195s class A: 195s a:int 195s b:int=2 195s c:list=attrs.field(factory=list) 195s d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) 195s 195s def test_something(): 195s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 195s assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) 195s """ 195s > ).run_pytest( 195s ["--inline-snapshot=fix"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s from inline_snapshot import snapshot,Is 195s import attrs 195s 195s @attrs.define 195s class A: 195s a:int 195s b:int=2 195s c:list=attrs.field(factory=list) 195s d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) 195s 195s def test_something(): 195s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 195s assert A(a=2,b=3) == snapshot(A(a=2,b=3,c=[],d=11)) 195s """ 195s } 195s ), 195s ).run_pytest( 195s ["--inline-snapshot=update"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s from inline_snapshot import snapshot,Is 195s import attrs 195s 195s @attrs.define 195s class A: 195s a:int 195s b:int=2 195s c:list=attrs.field(factory=list) 195s d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) 195s 195s def test_something(): 195s assert A(a=1) == snapshot(A(a=1)) 195s assert A(a=2,b=3) == snapshot(A(a=2,b=3)) 195s """ 195s } 195s ), 195s ) 195s 195s tests/adapter/test_dataclass.py:139: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = ['--inline-snapshot=fix'] 195s 195s def run_pytest( 195s self, 195s args: list[str] = [], 195s *, 195s term_columns=80, 195s env: dict[str, str] = {}, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s stderr: Snapshot[str] | None = None, 195s returncode: Snapshot[int] | None = None, 195s ) -> Example: 195s """Run pytest with the given args and env variables in an seperate 195s process. 195s 195s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 195s 195s Parameters: 195s args: pytest arguments like "--inline-snapshot=fix" 195s env: dict of environment variables 195s changed_files: snapshot of files which are changed by this run. 195s report: snapshot of the report at the end of the pytest run. 195s stderr: pytest stderr output 195s returncode: snapshot of the pytest returncode. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s self._write_files(tmp_path) 195s 195s cmd = [sys.executable, "-m", "pytest", *args] 195s 195s command_env = dict(os.environ) 195s command_env["TERM"] = "unknown" 195s command_env["COLUMNS"] = str( 195s term_columns + 1 if platform.system() == "Windows" else term_columns 195s ) 195s command_env.pop("CI", None) 195s 195s command_env.update(env) 195s 195s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 195s 195s print("run>", *cmd) 195s print("stdout:") 195s print(result.stdout.decode()) 195s print("stderr:") 195s print(result.stderr.decode()) 195s 195s if returncode is not None: 195s assert result.returncode == returncode 195s 195s if stderr is not None: 195s assert result.stderr.decode() == stderr 195s 195s if report is not None: 195s 195s report_list = [] 195s record = False 195s for line in result.stdout.decode().splitlines(): 195s line = line.strip() 195s if line.startswith("===="): 195s record = False 195s 195s if record and line: 195s report_list.append(line) 195s 195s if line.startswith("====") and "inline snapshot" in line: 195s record = True 195s 195s report_str = "\n".join(report_list) 195s 195s assert normalize(report_str) == report, repr(report_str) 195s 195s if changed_files is not None: 195s current_files = {} 195s 195s for name, content in sorted(self._read_files(tmp_path).items()): 195s if name not in self.files or self.files[name] != content: 195s current_files[name] = content 195s > assert changed_files == current_files 195s E AssertionError: assert {'test_someth...=[],d=11))\n'} == {} 195s E 195s E Left contains 1 more item: 195s E {'test_something.py': 'from inline_snapshot import snapshot,Is\n' 195s E 'import attrs\n' 195s E '\n' 195s E '@attrs.define\n' 195s E 'class A:\n'... 195s E 195s E ...Full output truncated (11 lines hidden), use '-vv' to show 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot,Is 195s import attrs 195s 195s @attrs.define 195s class A: 195s a:int 195s b:int=2 195s c:list=attrs.field(factory=list) 195s d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) 195s 195s def test_something(): 195s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 195s assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) 195s 195s 195s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmpws4co2b3 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_something.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ________________________________ test_something ________________________________ 195s 195s def test_something(): 195s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 195s > assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) 195s 195s test_something.py:13: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:194: in assign 195s result_kwargs[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '2 ', filename = PosixPath('/tmp/tmpws4co2b3/test_something.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_something.py::test_something - TypeError: CliRunner.__init__() go... 195s ============================== 1 failed in 0.20s =============================== 195s 195s stderr: 195s 195s ____________________________ test_attrs_field_repr _____________________________ 195s 195s def test_attrs_field_repr(): 195s 195s Example( 195s """\ 195s from inline_snapshot import snapshot 195s import attrs 195s 195s @attrs.define 195s class container: 195s a: int 195s b: int = attrs.field(default=5,repr=False) 195s 195s assert container(a=1,b=5) == snapshot() 195s """ 195s > ).run_pytest( 195s ["--inline-snapshot=create"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s from inline_snapshot import snapshot 195s import attrs 195s 195s @attrs.define 195s class container: 195s a: int 195s b: int = attrs.field(default=5,repr=False) 195s 195s assert container(a=1,b=5) == snapshot(container(a=1)) 195s """ 195s } 195s ), 195s ).run_pytest() 195s 195s tests/adapter/test_dataclass.py:198: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = ['--inline-snapshot=create'] 195s 195s def run_pytest( 195s self, 195s args: list[str] = [], 195s *, 195s term_columns=80, 195s env: dict[str, str] = {}, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s stderr: Snapshot[str] | None = None, 195s returncode: Snapshot[int] | None = None, 195s ) -> Example: 195s """Run pytest with the given args and env variables in an seperate 195s process. 195s 195s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 195s 195s Parameters: 195s args: pytest arguments like "--inline-snapshot=fix" 195s env: dict of environment variables 195s changed_files: snapshot of files which are changed by this run. 195s report: snapshot of the report at the end of the pytest run. 195s stderr: pytest stderr output 195s returncode: snapshot of the pytest returncode. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s self._write_files(tmp_path) 195s 195s cmd = [sys.executable, "-m", "pytest", *args] 195s 195s command_env = dict(os.environ) 195s command_env["TERM"] = "unknown" 195s command_env["COLUMNS"] = str( 195s term_columns + 1 if platform.system() == "Windows" else term_columns 195s ) 195s command_env.pop("CI", None) 195s 195s command_env.update(env) 195s 195s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 195s 195s print("run>", *cmd) 195s print("stdout:") 195s print(result.stdout.decode()) 195s print("stderr:") 195s print(result.stderr.decode()) 195s 195s if returncode is not None: 195s assert result.returncode == returncode 195s 195s if stderr is not None: 195s assert result.stderr.decode() == stderr 195s 195s if report is not None: 195s 195s report_list = [] 195s record = False 195s for line in result.stdout.decode().splitlines(): 195s line = line.strip() 195s if line.startswith("===="): 195s record = False 195s 195s if record and line: 195s report_list.append(line) 195s 195s if line.startswith("====") and "inline snapshot" in line: 195s record = True 195s 195s report_str = "\n".join(report_list) 195s 195s assert normalize(report_str) == report, repr(report_str) 195s 195s if changed_files is not None: 195s current_files = {} 195s 195s for name, content in sorted(self._read_files(tmp_path).items()): 195s if name not in self.files or self.files[name] != content: 195s current_files[name] = content 195s > assert changed_files == current_files 195s E AssertionError: assert {'test_someth...iner(a=1))\n'} == {} 195s E 195s E Left contains 1 more item: 195s E {'test_something.py': 'from inline_snapshot import snapshot\n' 195s E 'import attrs\n' 195s E '\n' 195s E '@attrs.define\n' 195s E 'class container:\n'... 195s E 195s E ...Full output truncated (5 lines hidden), use '-vv' to show 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot 195s import attrs 195s 195s @attrs.define 195s class container: 195s a: int 195s b: int = attrs.field(default=5,repr=False) 195s 195s assert container(a=1,b=5) == snapshot() 195s 195s 195s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmpxler1x2t 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 0 items / 1 error 195s 195s ==================================== ERRORS ==================================== 195s ______________________ ERROR collecting test_something.py ______________________ 195s test_something.py:9: in 195s assert container(a=1,b=5) == snapshot() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 195s runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s ERROR test_something.py - TypeError: CliRunner.__init__() got an unexpected k... 195s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 195s =============================== 1 error in 0.28s =============================== 195s 195s stderr: 195s 195s ___________________________ test_disabled[executing] ___________________________ 195s 195s executing_used = True 195s 195s def test_disabled(executing_used): 195s Example( 195s """\ 195s from inline_snapshot import snapshot 195s from dataclasses import dataclass 195s 195s @dataclass 195s class A: 195s a:int 195s 195s def test_something(): 195s assert A(a=3) == snapshot(A(a=5)),"not equal" 195s """ 195s > ).run_inline( 195s changed_files=snapshot({}), 195s raises=snapshot( 195s """\ 195s AssertionError: 195s not equal\ 195s """ 195s ), 195s ) 195s 195s tests/adapter/test_dataclass.py:261: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 195s assert raises == f"{type(raised_exception).__name__}:\n" + str( 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 195s filename = PosixPath('/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/adapter/test_dataclass.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot 195s from dataclasses import dataclass 195s 195s @dataclass 195s class A: 195s a:int 195s 195s def test_something(): 195s assert A(a=3) == snapshot(A(a=5)),"not equal" 195s 195s 195s run> pytest /tmp/tmp7jejgfjj/test_something.py 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 195s v() 195s File "/tmp/tmp7jejgfjj/test_something.py", line 9, in test_something 195s assert A(a=3) == snapshot(A(a=5)),"not equal" 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 195s return self == other 195s ^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 195s self._changes.append(next(it)) 195s ^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 194, in assign 195s result_kwargs[key] = yield from self.get_adapter( 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 195s new_code = self.context.file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s _______________________ test_disabled[without-executing] _______________________ 195s 195s executing_used = False 195s 195s def test_disabled(executing_used): 195s Example( 195s """\ 195s from inline_snapshot import snapshot 195s from dataclasses import dataclass 195s 195s @dataclass 195s class A: 195s a:int 195s 195s def test_something(): 195s assert A(a=3) == snapshot(A(a=5)),"not equal" 195s """ 195s > ).run_inline( 195s changed_files=snapshot({}), 195s raises=snapshot( 195s """\ 195s AssertionError: 195s not equal\ 195s """ 195s ), 195s ) 195s 195s tests/adapter/test_dataclass.py:261: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 195s assert raises == f"{type(raised_exception).__name__}:\n" + str( 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:53: in assign 195s and self.context.file._token_of_node(old_node) != new_token 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s node = 195s 195s def _token_of_node(self, node): 195s 195s return list( 195s normalize( 195s [ 195s simple_token(t.type, t.string) 195s > for t in self._source.asttokens().get_tokens(node) 195s if t.type not in ignore_tokens 195s ] 195s ) 195s ) 195s E AttributeError: 'NoneType' object has no attribute 'asttokens' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:45: AttributeError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot 195s from dataclasses import dataclass 195s 195s @dataclass 195s class A: 195s a:int 195s 195s def test_something(): 195s assert A(a=3) == snapshot(A(a=5)),"not equal" 195s 195s 195s run> pytest /tmp/tmpdl_wccdt/test_something.py 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 195s v() 195s File "/tmp/tmpdl_wccdt/test_something.py", line 9, in test_something 195s assert A(a=3) == snapshot(A(a=5)),"not equal" 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError: not equal 195s ______________________________ test_add_argument _______________________________ 195s 195s def test_add_argument(): 195s Example( 195s """\ 195s from inline_snapshot import snapshot 195s from dataclasses import dataclass 195s 195s @dataclass 195s class A: 195s a:int=0 195s b:int=0 195s c:int=0 195s 195s def test_something(): 195s assert A(a=3,b=3,c=3) == snapshot(A(b=3)),"not equal" 195s """ 195s > ).run_inline( 195s ["--inline-snapshot=fix"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s from inline_snapshot import snapshot 195s from dataclasses import dataclass 195s 195s @dataclass 195s class A: 195s a:int=0 195s b:int=0 195s c:int=0 195s 195s def test_something(): 195s assert A(a=3,b=3,c=3) == snapshot(A(a = 3, b=3, c = 3)),"not equal" 195s """ 195s } 195s ), 195s raises=snapshot(None), 195s ) 195s 195s tests/adapter/test_dataclass.py:322: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 195s assert raises == f"{type(raised_exception).__name__}:\n" + str( 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 195s filename = PosixPath('/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/adapter/test_dataclass.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot 195s from dataclasses import dataclass 195s 195s @dataclass 195s class A: 195s a:int=0 195s b:int=0 195s c:int=0 195s 195s def test_something(): 195s assert A(a=3,b=3,c=3) == snapshot(A(b=3)),"not equal" 195s 195s 195s run> pytest /tmp/tmpadz6hejw/test_something.py 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 195s v() 195s File "/tmp/tmpadz6hejw/test_something.py", line 11, in test_something 195s assert A(a=3,b=3,c=3) == snapshot(A(b=3)),"not equal" 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 195s return self == other 195s ^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 195s self._changes.append(next(it)) 195s ^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 207, in assign 195s new_code=self.context.file._value_to_code(value), 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 37, in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s _______________________ test_remove_positional_argument ________________________ 195s 195s def test_remove_positional_argument(): 195s Example( 195s """\ 195s from inline_snapshot import snapshot 195s 195s from inline_snapshot._adapter.generic_call_adapter import GenericCallAdapter,Argument 195s 195s 195s class L: 195s def __init__(self,*l): 195s self.l=l 195s 195s def __eq__(self,other): 195s if not isinstance(other,L): 195s return NotImplemented 195s return other.l==self.l 195s 195s class LAdapter(GenericCallAdapter): 195s @classmethod 195s def check_type(cls, typ): 195s return issubclass(typ,L) 195s 195s @classmethod 195s def arguments(cls, value): 195s return ([Argument(x) for x in value.l],{}) 195s 195s @classmethod 195s def argument(cls, value, pos_or_name): 195s assert isinstance(pos_or_name,int) 195s return value.l[pos_or_name] 195s 195s def test_L1(): 195s assert L(1,2) == snapshot(L(1)), "not equal" 195s 195s def test_L2(): 195s assert L(1,2) == snapshot(L(1, 2, 3)), "not equal" 195s """ 195s > ).run_pytest( 195s ["--inline-snapshot=fix"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s from inline_snapshot import snapshot 195s 195s from inline_snapshot._adapter.generic_call_adapter import GenericCallAdapter,Argument 195s 195s 195s class L: 195s def __init__(self,*l): 195s self.l=l 195s 195s def __eq__(self,other): 195s if not isinstance(other,L): 195s return NotImplemented 195s return other.l==self.l 195s 195s class LAdapter(GenericCallAdapter): 195s @classmethod 195s def check_type(cls, typ): 195s return issubclass(typ,L) 195s 195s @classmethod 195s def arguments(cls, value): 195s return ([Argument(x) for x in value.l],{}) 195s 195s @classmethod 195s def argument(cls, value, pos_or_name): 195s assert isinstance(pos_or_name,int) 195s return value.l[pos_or_name] 195s 195s def test_L1(): 195s assert L(1,2) == snapshot(L(1, 2)), "not equal" 195s 195s def test_L2(): 195s assert L(1,2) == snapshot(L(1, 2)), "not equal" 195s """ 195s } 195s ), 195s ) 195s 195s tests/adapter/test_dataclass.py:408: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = ['--inline-snapshot=fix'] 195s 195s def run_pytest( 195s self, 195s args: list[str] = [], 195s *, 195s term_columns=80, 195s env: dict[str, str] = {}, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s stderr: Snapshot[str] | None = None, 195s returncode: Snapshot[int] | None = None, 195s ) -> Example: 195s """Run pytest with the given args and env variables in an seperate 195s process. 195s 195s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 195s 195s Parameters: 195s args: pytest arguments like "--inline-snapshot=fix" 195s env: dict of environment variables 195s changed_files: snapshot of files which are changed by this run. 195s report: snapshot of the report at the end of the pytest run. 195s stderr: pytest stderr output 195s returncode: snapshot of the pytest returncode. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s self._write_files(tmp_path) 195s 195s cmd = [sys.executable, "-m", "pytest", *args] 195s 195s command_env = dict(os.environ) 195s command_env["TERM"] = "unknown" 195s command_env["COLUMNS"] = str( 195s term_columns + 1 if platform.system() == "Windows" else term_columns 195s ) 195s command_env.pop("CI", None) 195s 195s command_env.update(env) 195s 195s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 195s 195s print("run>", *cmd) 195s print("stdout:") 195s print(result.stdout.decode()) 195s print("stderr:") 195s print(result.stderr.decode()) 195s 195s if returncode is not None: 195s assert result.returncode == returncode 195s 195s if stderr is not None: 195s assert result.stderr.decode() == stderr 195s 195s if report is not None: 195s 195s report_list = [] 195s record = False 195s for line in result.stdout.decode().splitlines(): 195s line = line.strip() 195s if line.startswith("===="): 195s record = False 195s 195s if record and line: 195s report_list.append(line) 195s 195s if line.startswith("====") and "inline snapshot" in line: 195s record = True 195s 195s report_str = "\n".join(report_list) 195s 195s assert normalize(report_str) == report, repr(report_str) 195s 195s if changed_files is not None: 195s current_files = {} 195s 195s for name, content in sorted(self._read_files(tmp_path).items()): 195s if name not in self.files or self.files[name] != content: 195s current_files[name] = content 195s > assert changed_files == current_files 195s E assert {'test_someth...not equal"\n'} == {} 195s E 195s E Left contains 1 more item: 195s E {'test_something.py': 'from inline_snapshot import snapshot\n' 195s E '\n' 195s E 'from inline_snapshot._adapter.generic_call_adapter ' 195s E 'import GenericCallAdapter,Argument\n' 195s E '\n'... 195s E 195s E ...Full output truncated (30 lines hidden), use '-vv' to show 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot 195s 195s from inline_snapshot._adapter.generic_call_adapter import GenericCallAdapter,Argument 195s 195s 195s class L: 195s def __init__(self,*l): 195s self.l=l 195s 195s def __eq__(self,other): 195s if not isinstance(other,L): 195s return NotImplemented 195s return other.l==self.l 195s 195s class LAdapter(GenericCallAdapter): 195s @classmethod 195s def check_type(cls, typ): 195s return issubclass(typ,L) 195s 195s @classmethod 195s def arguments(cls, value): 195s return ([Argument(x) for x in value.l],{}) 195s 195s @classmethod 195s def argument(cls, value, pos_or_name): 195s assert isinstance(pos_or_name,int) 195s return value.l[pos_or_name] 195s 195s def test_L1(): 195s assert L(1,2) == snapshot(L(1)), "not equal" 195s 195s def test_L2(): 195s assert L(1,2) == snapshot(L(1, 2, 3)), "not equal" 195s 195s 195s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmp_5uybdhy 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 2 items 195s 195s test_something.py F. [100%] 195s 195s =================================== FAILURES =================================== 195s ___________________________________ test_L1 ____________________________________ 195s 195s def test_L1(): 195s > assert L(1,2) == snapshot(L(1)), "not equal" 195s 195s test_something.py:30: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:162: in assign 195s new_code=self.context.file._value_to_code(value.value), 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '2 ', filename = PosixPath('/tmp/tmp_5uybdhy/test_something.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s ──────────────────────────────── Fix snapshots ───────────────────────────────── 195s =========================== short test summary info ============================ 195s FAILED test_something.py::test_L1 - TypeError: CliRunner.__init__() got an un... 195s 195s stderr: 195s Traceback (most recent call last): 195s File "", line 198, in _run_module_as_main 195s File "", line 88, in _run_code 195s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 195s raise SystemExit(pytest.console_main()) 195s ^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 195s code = main() 195s ^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 195s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 195s return wrap_session(config, _main) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 195s config.hook.pytest_sessionfinish( 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 195s teardown.send(result) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 195s self.config.hook.pytest_terminal_summary( 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary 195s diff = file.diff() 195s ^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff 195s unified_diff(self.source.splitlines(), self.new_code().splitlines()), 195s ^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s ^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s _______________________________ test_namedtuple ________________________________ 195s 195s def test_namedtuple(): 195s Example( 195s """\ 195s from inline_snapshot import snapshot 195s from collections import namedtuple 195s 195s T=namedtuple("T","a,b") 195s 195s def test_tuple(): 195s assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" 195s """ 195s > ).run_pytest( 195s ["--inline-snapshot=fix"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s from inline_snapshot import snapshot 195s from collections import namedtuple 195s 195s T=namedtuple("T","a,b") 195s 195s def test_tuple(): 195s assert T(a=1,b=2) == snapshot(T(a=1, b=2)), "not equal" 195s """ 195s } 195s ), 195s ) 195s 195s tests/adapter/test_dataclass.py:463: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = ['--inline-snapshot=fix'] 195s 195s def run_pytest( 195s self, 195s args: list[str] = [], 195s *, 195s term_columns=80, 195s env: dict[str, str] = {}, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s stderr: Snapshot[str] | None = None, 195s returncode: Snapshot[int] | None = None, 195s ) -> Example: 195s """Run pytest with the given args and env variables in an seperate 195s process. 195s 195s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 195s 195s Parameters: 195s args: pytest arguments like "--inline-snapshot=fix" 195s env: dict of environment variables 195s changed_files: snapshot of files which are changed by this run. 195s report: snapshot of the report at the end of the pytest run. 195s stderr: pytest stderr output 195s returncode: snapshot of the pytest returncode. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s self._write_files(tmp_path) 195s 195s cmd = [sys.executable, "-m", "pytest", *args] 195s 195s command_env = dict(os.environ) 195s command_env["TERM"] = "unknown" 195s command_env["COLUMNS"] = str( 195s term_columns + 1 if platform.system() == "Windows" else term_columns 195s ) 195s command_env.pop("CI", None) 195s 195s command_env.update(env) 195s 195s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 195s 195s print("run>", *cmd) 195s print("stdout:") 195s print(result.stdout.decode()) 195s print("stderr:") 195s print(result.stderr.decode()) 195s 195s if returncode is not None: 195s assert result.returncode == returncode 195s 195s if stderr is not None: 195s assert result.stderr.decode() == stderr 195s 195s if report is not None: 195s 195s report_list = [] 195s record = False 195s for line in result.stdout.decode().splitlines(): 195s line = line.strip() 195s if line.startswith("===="): 195s record = False 195s 195s if record and line: 195s report_list.append(line) 195s 195s if line.startswith("====") and "inline snapshot" in line: 195s record = True 195s 195s report_str = "\n".join(report_list) 195s 195s assert normalize(report_str) == report, repr(report_str) 195s 195s if changed_files is not None: 195s current_files = {} 195s 195s for name, content in sorted(self._read_files(tmp_path).items()): 195s if name not in self.files or self.files[name] != content: 195s current_files[name] = content 195s > assert changed_files == current_files 195s E assert {'test_someth...not equal"\n'} == {} 195s E 195s E Left contains 1 more item: 195s E {'test_something.py': 'from inline_snapshot import snapshot\n' 195s E 'from collections import namedtuple\n' 195s E '\n' 195s E 'T=namedtuple("T","a,b")\n' 195s E '\n'... 195s E 195s E ...Full output truncated (4 lines hidden), use '-vv' to show 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot 195s from collections import namedtuple 195s 195s T=namedtuple("T","a,b") 195s 195s def test_tuple(): 195s assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" 195s 195s 195s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmp3k1f4dv_ 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_something.py F [100%] 195s 195s =================================== FAILURES =================================== 195s __________________________________ test_tuple __________________________________ 195s 195s def test_tuple(): 195s > assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" 195s 195s test_something.py:7: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:194: in assign 195s result_kwargs[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '2 ', filename = PosixPath('/tmp/tmp3k1f4dv_/test_something.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_something.py::test_tuple - TypeError: CliRunner.__init__() got an... 195s ============================== 1 failed in 0.22s =============================== 195s 195s stderr: 195s 195s _______________________________ test_defaultdict _______________________________ 195s 195s def test_defaultdict(): 195s Example( 195s """\ 195s from inline_snapshot import snapshot 195s from collections import defaultdict 195s 195s 195s def test_tuple(): 195s d=defaultdict(list) 195s d[1].append(2) 195s assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" 195s """ 195s > ).run_pytest( 195s ["--inline-snapshot=fix"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s from inline_snapshot import snapshot 195s from collections import defaultdict 195s 195s 195s def test_tuple(): 195s d=defaultdict(list) 195s d[1].append(2) 195s assert d == snapshot(defaultdict(list, {1: [2]})), "not equal" 195s """ 195s } 195s ), 195s ) 195s 195s tests/adapter/test_dataclass.py:493: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = ['--inline-snapshot=fix'] 195s 195s def run_pytest( 195s self, 195s args: list[str] = [], 195s *, 195s term_columns=80, 195s env: dict[str, str] = {}, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s stderr: Snapshot[str] | None = None, 195s returncode: Snapshot[int] | None = None, 195s ) -> Example: 195s """Run pytest with the given args and env variables in an seperate 195s process. 195s 195s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 195s 195s Parameters: 195s args: pytest arguments like "--inline-snapshot=fix" 195s env: dict of environment variables 195s changed_files: snapshot of files which are changed by this run. 195s report: snapshot of the report at the end of the pytest run. 195s stderr: pytest stderr output 195s returncode: snapshot of the pytest returncode. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s self._write_files(tmp_path) 195s 195s cmd = [sys.executable, "-m", "pytest", *args] 195s 195s command_env = dict(os.environ) 195s command_env["TERM"] = "unknown" 195s command_env["COLUMNS"] = str( 195s term_columns + 1 if platform.system() == "Windows" else term_columns 195s ) 195s command_env.pop("CI", None) 195s 195s command_env.update(env) 195s 195s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 195s 195s print("run>", *cmd) 195s print("stdout:") 195s print(result.stdout.decode()) 195s print("stderr:") 195s print(result.stderr.decode()) 195s 195s if returncode is not None: 195s assert result.returncode == returncode 195s 195s if stderr is not None: 195s assert result.stderr.decode() == stderr 195s 195s if report is not None: 195s 195s report_list = [] 195s record = False 195s for line in result.stdout.decode().splitlines(): 195s line = line.strip() 195s if line.startswith("===="): 195s record = False 195s 195s if record and line: 195s report_list.append(line) 195s 195s if line.startswith("====") and "inline snapshot" in line: 195s record = True 195s 195s report_str = "\n".join(report_list) 195s 195s assert normalize(report_str) == report, repr(report_str) 195s 195s if changed_files is not None: 195s current_files = {} 195s 195s for name, content in sorted(self._read_files(tmp_path).items()): 195s if name not in self.files or self.files[name] != content: 195s current_files[name] = content 195s > assert changed_files == current_files 195s E assert {'test_someth...not equal"\n'} == {} 195s E 195s E Left contains 1 more item: 195s E {'test_something.py': 'from inline_snapshot import snapshot\n' 195s E 'from collections import defaultdict\n' 195s E '\n' 195s E '\n' 195s E 'def test_tuple():\n'... 195s E 195s E ...Full output truncated (5 lines hidden), use '-vv' to show 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot 195s from collections import defaultdict 195s 195s 195s def test_tuple(): 195s d=defaultdict(list) 195s d[1].append(2) 195s assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" 195s 195s 195s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmpi6u0thmg 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_something.py F [100%] 195s 195s =================================== FAILURES =================================== 195s __________________________________ test_tuple __________________________________ 195s 195s def test_tuple(): 195s d=defaultdict(list) 195s d[1].append(2) 195s > assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" 195s 195s test_something.py:8: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:140: in assign 195s result = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '2 ', filename = PosixPath('/tmp/tmpi6u0thmg/test_something.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_something.py::test_tuple - TypeError: CliRunner.__init__() got an... 195s ============================== 1 failed in 0.20s =============================== 195s 195s stderr: 195s 195s __________________________ test_dataclass_field_repr ___________________________ 195s 195s def test_dataclass_field_repr(): 195s 195s Example( 195s """\ 195s from inline_snapshot import snapshot 195s from dataclasses import dataclass,field 195s 195s @dataclass 195s class container: 195s a: int 195s b: int = field(default=5,repr=False) 195s 195s assert container(a=1,b=5) == snapshot() 195s """ 195s > ).run_inline( 195s ["--inline-snapshot=create"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s from inline_snapshot import snapshot 195s from dataclasses import dataclass,field 195s 195s @dataclass 195s class container: 195s a: int 195s b: int = field(default=5,repr=False) 195s 195s assert container(a=1,b=5) == snapshot(container(a=1)) 195s """ 195s } 195s ), 195s ).run_inline() 195s 195s tests/adapter/test_dataclass.py:526: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = ['--inline-snapshot=create'] 195s 195s def run_inline( 195s self, 195s args: list[str] = [], 195s *, 195s reported_categories: Snapshot[list[Category]] | None = None, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s raises: Snapshot[str] | None = None, 195s ) -> Example: 195s """Execute the example files in process and run every `test_*` 195s function. 195s 195s This is useful for fast test execution. 195s 195s Parameters: 195s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 195s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 195s changed_files: snapshot of files which are changed by this run. 195s raises: snapshot of the exception which is raised during the test execution. 195s It is required if your code raises an exception. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s parser = ArgumentParser() 195s 195s parser.add_argument( 195s "--inline-snapshot", 195s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 195s dest="inline_snapshot", 195s help="update specific snapshot values:\n" 195s "disable: disable the snapshot logic\n" 195s "short-report: show a short report\n" 195s "report: show a longer report with a diff report\n" 195s "review: allow to approve the changes interactive\n" 195s "create: creates snapshots which are currently not defined\n" 195s "update: update snapshots even if they are defined\n" 195s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 195s "fix: change snapshots which currently break your tests\n", 195s ) 195s parsed_args = parser.parse_args(args) 195s flags = (parsed_args.inline_snapshot or "").split(",") 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s 195s self._write_files(tmp_path) 195s 195s raised_exception = None 195s with snapshot_env(): 195s with ChangeRecorder().activate() as recorder: 195s _inline_snapshot._update_flags = Flags({*flags}) 195s inline_snapshot._external.storage = ( 195s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 195s ) 195s 195s try: 195s for filename in tmp_path.glob("*.py"): 195s globals: dict[str, Any] = {} 195s print("run> pytest", filename) 195s exec( 195s compile(filename.read_text("utf-8"), filename, "exec"), 195s globals, 195s ) 195s 195s # run all test_* functions 195s for k, v in globals.items(): 195s if k.startswith("test_") and callable(v): 195s v() 195s except Exception as e: 195s traceback.print_exc() 195s raised_exception = e 195s 195s finally: 195s _inline_snapshot._active = False 195s 195s changes = [] 195s for snapshot in _inline_snapshot.snapshots.values(): 195s changes += snapshot._changes() 195s 195s snapshot_flags = {change.flag for change in changes} 195s 195s apply_all( 195s [ 195s change 195s for change in changes 195s if change.flag in _inline_snapshot._update_flags.to_set() 195s ] 195s ) 195s recorder.fix_all() 195s 195s report_output = StringIO() 195s console = Console(file=report_output) 195s 195s # TODO: add all the report output here 195s report_problems(console) 195s 195s if reported_categories is not None: 195s assert sorted(snapshot_flags) == reported_categories 195s 195s if raised_exception is not None: 195s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 195s raised_exception 195s ) 195s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 195s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot 195s from dataclasses import dataclass,field 195s 195s @dataclass 195s class container: 195s a: int 195s b: int = field(default=5,repr=False) 195s 195s assert container(a=1,b=5) == snapshot() 195s 195s 195s run> pytest /tmp/tmpgruthlz5/test_something.py 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 185, in run_inline 195s exec( 195s File "/tmp/tmpgruthlz5/test_something.py", line 9, in 195s assert container(a=1,b=5) == snapshot() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 195s return self == other 195s ^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 195s self._changes.append(next(it)) 195s ^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 195s new_code = self.context.file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s ______________________________ test_dataclass_var ______________________________ 195s 195s def test_dataclass_var(): 195s 195s Example( 195s """\ 195s from inline_snapshot import snapshot,Is 195s from dataclasses import dataclass,field 195s 195s @dataclass 195s class container: 195s a: int 195s 195s def test_list(): 195s l=container(5) 195s assert l == snapshot(l), "not equal" 195s """ 195s > ).run_inline( 195s ["--inline-snapshot=update"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s from inline_snapshot import snapshot,Is 195s from dataclasses import dataclass,field 195s 195s @dataclass 195s class container: 195s a: int 195s 195s def test_list(): 195s l=container(5) 195s assert l == snapshot(container(a=5)), "not equal" 195s """ 195s } 195s ), 195s ) 195s 195s tests/adapter/test_dataclass.py:561: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = ['--inline-snapshot=update'] 195s 195s def run_inline( 195s self, 195s args: list[str] = [], 195s *, 195s reported_categories: Snapshot[list[Category]] | None = None, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s raises: Snapshot[str] | None = None, 195s ) -> Example: 195s """Execute the example files in process and run every `test_*` 195s function. 195s 195s This is useful for fast test execution. 195s 195s Parameters: 195s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 195s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 195s changed_files: snapshot of files which are changed by this run. 195s raises: snapshot of the exception which is raised during the test execution. 195s It is required if your code raises an exception. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s parser = ArgumentParser() 195s 195s parser.add_argument( 195s "--inline-snapshot", 195s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 195s dest="inline_snapshot", 195s help="update specific snapshot values:\n" 195s "disable: disable the snapshot logic\n" 195s "short-report: show a short report\n" 195s "report: show a longer report with a diff report\n" 195s "review: allow to approve the changes interactive\n" 195s "create: creates snapshots which are currently not defined\n" 195s "update: update snapshots even if they are defined\n" 195s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 195s "fix: change snapshots which currently break your tests\n", 195s ) 195s parsed_args = parser.parse_args(args) 195s flags = (parsed_args.inline_snapshot or "").split(",") 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s 195s self._write_files(tmp_path) 195s 195s raised_exception = None 195s with snapshot_env(): 195s with ChangeRecorder().activate() as recorder: 195s _inline_snapshot._update_flags = Flags({*flags}) 195s inline_snapshot._external.storage = ( 195s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 195s ) 195s 195s try: 195s for filename in tmp_path.glob("*.py"): 195s globals: dict[str, Any] = {} 195s print("run> pytest", filename) 195s exec( 195s compile(filename.read_text("utf-8"), filename, "exec"), 195s globals, 195s ) 195s 195s # run all test_* functions 195s for k, v in globals.items(): 195s if k.startswith("test_") and callable(v): 195s v() 195s except Exception as e: 195s traceback.print_exc() 195s raised_exception = e 195s 195s finally: 195s _inline_snapshot._active = False 195s 195s changes = [] 195s for snapshot in _inline_snapshot.snapshots.values(): 195s changes += snapshot._changes() 195s 195s snapshot_flags = {change.flag for change in changes} 195s 195s apply_all( 195s [ 195s change 195s for change in changes 195s if change.flag in _inline_snapshot._update_flags.to_set() 195s ] 195s ) 195s recorder.fix_all() 195s 195s report_output = StringIO() 195s console = Console(file=report_output) 195s 195s # TODO: add all the report output here 195s report_problems(console) 195s 195s if reported_categories is not None: 195s assert sorted(snapshot_flags) == reported_categories 195s 195s if raised_exception is not None: 195s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 195s raised_exception 195s ) 195s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 195s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot,Is 195s from dataclasses import dataclass,field 195s 195s @dataclass 195s class container: 195s a: int 195s 195s def test_list(): 195s l=container(5) 195s assert l == snapshot(l), "not equal" 195s 195s 195s run> pytest /tmp/tmpxsy_tgdp/test_something.py 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 195s v() 195s File "/tmp/tmpxsy_tgdp/test_something.py", line 10, in test_list 195s assert l == snapshot(l), "not equal" 195s ^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 195s return self == other 195s ^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 195s self._changes.append(next(it)) 195s ^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 101, in assign 195s result = yield from self.value_assign(old_value, old_node, new_value) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py", line 87, in value_assign 195s result = yield from adapter.assign(old_value, old_node, new_value) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 195s new_code = self.context.file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s ________________________________ test_dict_var _________________________________ 195s 195s def test_dict_var(): 195s 195s Example( 195s """\ 195s from inline_snapshot import snapshot,Is 195s 195s def test_list(): 195s l={1:2} 195s assert l == snapshot(l), "not equal" 195s """ 195s > ).run_inline( 195s ["--inline-snapshot=update"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s from inline_snapshot import snapshot,Is 195s 195s def test_list(): 195s l={1:2} 195s assert l == snapshot({1: 2}), "not equal" 195s """ 195s } 195s ), 195s ) 195s 195s tests/adapter/test_dict.py:15: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = ['--inline-snapshot=update'] 195s 195s def run_inline( 195s self, 195s args: list[str] = [], 195s *, 195s reported_categories: Snapshot[list[Category]] | None = None, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s raises: Snapshot[str] | None = None, 195s ) -> Example: 195s """Execute the example files in process and run every `test_*` 195s function. 195s 195s This is useful for fast test execution. 195s 195s Parameters: 195s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 195s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 195s changed_files: snapshot of files which are changed by this run. 195s raises: snapshot of the exception which is raised during the test execution. 195s It is required if your code raises an exception. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s parser = ArgumentParser() 195s 195s parser.add_argument( 195s "--inline-snapshot", 195s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 195s dest="inline_snapshot", 195s help="update specific snapshot values:\n" 195s "disable: disable the snapshot logic\n" 195s "short-report: show a short report\n" 195s "report: show a longer report with a diff report\n" 195s "review: allow to approve the changes interactive\n" 195s "create: creates snapshots which are currently not defined\n" 195s "update: update snapshots even if they are defined\n" 195s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 195s "fix: change snapshots which currently break your tests\n", 195s ) 195s parsed_args = parser.parse_args(args) 195s flags = (parsed_args.inline_snapshot or "").split(",") 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s 195s self._write_files(tmp_path) 195s 195s raised_exception = None 195s with snapshot_env(): 195s with ChangeRecorder().activate() as recorder: 195s _inline_snapshot._update_flags = Flags({*flags}) 195s inline_snapshot._external.storage = ( 195s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 195s ) 195s 195s try: 195s for filename in tmp_path.glob("*.py"): 195s globals: dict[str, Any] = {} 195s print("run> pytest", filename) 195s exec( 195s compile(filename.read_text("utf-8"), filename, "exec"), 195s globals, 195s ) 195s 195s # run all test_* functions 195s for k, v in globals.items(): 195s if k.startswith("test_") and callable(v): 195s v() 195s except Exception as e: 195s traceback.print_exc() 195s raised_exception = e 195s 195s finally: 195s _inline_snapshot._active = False 195s 195s changes = [] 195s for snapshot in _inline_snapshot.snapshots.values(): 195s changes += snapshot._changes() 195s 195s snapshot_flags = {change.flag for change in changes} 195s 195s apply_all( 195s [ 195s change 195s for change in changes 195s if change.flag in _inline_snapshot._update_flags.to_set() 195s ] 195s ) 195s recorder.fix_all() 195s 195s report_output = StringIO() 195s console = Console(file=report_output) 195s 195s # TODO: add all the report output here 195s report_problems(console) 195s 195s if reported_categories is not None: 195s assert sorted(snapshot_flags) == reported_categories 195s 195s if raised_exception is not None: 195s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 195s raised_exception 195s ) 195s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 195s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot,Is 195s 195s def test_list(): 195s l={1:2} 195s assert l == snapshot(l), "not equal" 195s 195s 195s run> pytest /tmp/tmp5_dnpt8g/test_something.py 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 195s v() 195s File "/tmp/tmp5_dnpt8g/test_something.py", line 5, in test_list 195s assert l == snapshot(l), "not equal" 195s ^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 195s return self == other 195s ^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 195s self._changes.append(next(it)) 195s ^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py", line 62, in assign 195s result = yield from self.value_assign(old_value, old_node, new_value) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py", line 87, in value_assign 195s result = yield from adapter.assign(old_value, old_node, new_value) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 195s new_code = self.context.file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s ____________________________ test_adapter_mismatch _____________________________ 195s 195s def test_adapter_mismatch(): 195s 195s Example( 195s """\ 195s from inline_snapshot import snapshot 195s 195s 195s def test_thing(): 195s assert [1,2] == snapshot({1:2}) 195s 195s """ 195s > ).run_inline( 195s ["--inline-snapshot=fix"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s from inline_snapshot import snapshot 195s 195s 195s def test_thing(): 195s assert [1,2] == snapshot([1, 2]) 195s 195s \ 195s """ 195s } 195s ), 195s ) 195s 195s tests/adapter/test_general.py:16: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = ['--inline-snapshot=fix'] 195s 195s def run_inline( 195s self, 195s args: list[str] = [], 195s *, 195s reported_categories: Snapshot[list[Category]] | None = None, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s raises: Snapshot[str] | None = None, 195s ) -> Example: 195s """Execute the example files in process and run every `test_*` 195s function. 195s 195s This is useful for fast test execution. 195s 195s Parameters: 195s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 195s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 195s changed_files: snapshot of files which are changed by this run. 195s raises: snapshot of the exception which is raised during the test execution. 195s It is required if your code raises an exception. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s parser = ArgumentParser() 195s 195s parser.add_argument( 195s "--inline-snapshot", 195s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 195s dest="inline_snapshot", 195s help="update specific snapshot values:\n" 195s "disable: disable the snapshot logic\n" 195s "short-report: show a short report\n" 195s "report: show a longer report with a diff report\n" 195s "review: allow to approve the changes interactive\n" 195s "create: creates snapshots which are currently not defined\n" 195s "update: update snapshots even if they are defined\n" 195s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 195s "fix: change snapshots which currently break your tests\n", 195s ) 195s parsed_args = parser.parse_args(args) 195s flags = (parsed_args.inline_snapshot or "").split(",") 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s 195s self._write_files(tmp_path) 195s 195s raised_exception = None 195s with snapshot_env(): 195s with ChangeRecorder().activate() as recorder: 195s _inline_snapshot._update_flags = Flags({*flags}) 195s inline_snapshot._external.storage = ( 195s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 195s ) 195s 195s try: 195s for filename in tmp_path.glob("*.py"): 195s globals: dict[str, Any] = {} 195s print("run> pytest", filename) 195s exec( 195s compile(filename.read_text("utf-8"), filename, "exec"), 195s globals, 195s ) 195s 195s # run all test_* functions 195s for k, v in globals.items(): 195s if k.startswith("test_") and callable(v): 195s v() 195s except Exception as e: 195s traceback.print_exc() 195s raised_exception = e 195s 195s finally: 195s _inline_snapshot._active = False 195s 195s changes = [] 195s for snapshot in _inline_snapshot.snapshots.values(): 195s changes += snapshot._changes() 195s 195s snapshot_flags = {change.flag for change in changes} 195s 195s apply_all( 195s [ 195s change 195s for change in changes 195s if change.flag in _inline_snapshot._update_flags.to_set() 195s ] 195s ) 195s recorder.fix_all() 195s 195s report_output = StringIO() 195s console = Console(file=report_output) 195s 195s # TODO: add all the report output here 195s report_problems(console) 195s 195s if reported_categories is not None: 195s assert sorted(snapshot_flags) == reported_categories 195s 195s if raised_exception is not None: 195s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 195s raised_exception 195s ) 195s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 195s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot 195s 195s 195s def test_thing(): 195s assert [1,2] == snapshot({1:2}) 195s 195s 195s 195s run> pytest /tmp/tmpmr9z8ro7/test_something.py 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 195s v() 195s File "/tmp/tmpmr9z8ro7/test_something.py", line 5, in test_thing 195s assert [1,2] == snapshot({1:2}) 195s ^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 195s return self == other 195s ^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 195s self._changes.append(next(it)) 195s ^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 195s new_code = self.context.file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s ___________________ test_list_adapter_create_inner_snapshot ____________________ 195s 195s def test_list_adapter_create_inner_snapshot(): 195s 195s Example( 195s """\ 195s from inline_snapshot import snapshot 195s from dirty_equals import IsInt 195s 195s def test_list(): 195s 195s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(),4]),"not equal" 195s """ 195s > ).run_inline( 195s ["--inline-snapshot=create"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s from inline_snapshot import snapshot 195s from dirty_equals import IsInt 195s 195s def test_list(): 195s 195s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(3),4]),"not equal" 195s """ 195s } 195s ), 195s raises=snapshot(None), 195s ) 195s 195s tests/adapter/test_sequence.py:17: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 195s assert raises == f"{type(raised_exception).__name__}:\n" + str( 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 195s filename = PosixPath('/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/adapter/test_sequence.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot 195s from dirty_equals import IsInt 195s 195s def test_list(): 195s 195s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(),4]),"not equal" 195s 195s 195s run> pytest /tmp/tmpq3ih0qyv/test_something.py 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 195s v() 195s File "/tmp/tmpq3ih0qyv/test_something.py", line 6, in test_list 195s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(),4]),"not equal" 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 195s return self == other 195s ^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 280, in __eq__ 195s return _return(self._visible_value() == other) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_unmanaged.py", line 44, in __eq__ 195s return self.value == other 195s ^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 195s self._changes.append(next(it)) 195s ^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 195s new_code = self.context.file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s _____________________ test_list_adapter_fix_inner_snapshot _____________________ 195s 195s def test_list_adapter_fix_inner_snapshot(): 195s 195s Example( 195s """\ 195s from inline_snapshot import snapshot 195s from dirty_equals import IsInt 195s 195s def test_list(): 195s 195s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(8),4]),"not equal" 195s """ 195s > ).run_inline( 195s ["--inline-snapshot=fix"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s from inline_snapshot import snapshot 195s from dirty_equals import IsInt 195s 195s def test_list(): 195s 195s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(3),4]),"not equal" 195s """ 195s } 195s ), 195s raises=snapshot(None), 195s ) 195s 195s tests/adapter/test_sequence.py:46: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 195s assert raises == f"{type(raised_exception).__name__}:\n" + str( 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 195s filename = PosixPath('/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/adapter/test_sequence.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot 195s from dirty_equals import IsInt 195s 195s def test_list(): 195s 195s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(8),4]),"not equal" 195s 195s 195s run> pytest /tmp/tmpcw8dr726/test_something.py 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 195s v() 195s File "/tmp/tmpcw8dr726/test_something.py", line 6, in test_list 195s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(8),4]),"not equal" 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 195s return self == other 195s ^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 280, in __eq__ 195s return _return(self._visible_value() == other) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_unmanaged.py", line 44, in __eq__ 195s return self.value == other 195s ^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 195s self._changes.append(next(it)) 195s ^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 195s new_code = self.context.file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s ________________________________ test_list_var _________________________________ 195s 195s def test_list_var(): 195s 195s Example( 195s """\ 195s from inline_snapshot import snapshot,Is 195s 195s def test_list(): 195s l=[1] 195s assert l == snapshot(l), "not equal" 195s """ 195s > ).run_inline( 195s ["--inline-snapshot=update"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s from inline_snapshot import snapshot,Is 195s 195s def test_list(): 195s l=[1] 195s assert l == snapshot([1]), "not equal" 195s """ 195s } 195s ), 195s ) 195s 195s tests/adapter/test_sequence.py:92: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = ['--inline-snapshot=update'] 195s 195s def run_inline( 195s self, 195s args: list[str] = [], 195s *, 195s reported_categories: Snapshot[list[Category]] | None = None, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s raises: Snapshot[str] | None = None, 195s ) -> Example: 195s """Execute the example files in process and run every `test_*` 195s function. 195s 195s This is useful for fast test execution. 195s 195s Parameters: 195s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 195s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 195s changed_files: snapshot of files which are changed by this run. 195s raises: snapshot of the exception which is raised during the test execution. 195s It is required if your code raises an exception. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s parser = ArgumentParser() 195s 195s parser.add_argument( 195s "--inline-snapshot", 195s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 195s dest="inline_snapshot", 195s help="update specific snapshot values:\n" 195s "disable: disable the snapshot logic\n" 195s "short-report: show a short report\n" 195s "report: show a longer report with a diff report\n" 195s "review: allow to approve the changes interactive\n" 195s "create: creates snapshots which are currently not defined\n" 195s "update: update snapshots even if they are defined\n" 195s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 195s "fix: change snapshots which currently break your tests\n", 195s ) 195s parsed_args = parser.parse_args(args) 195s flags = (parsed_args.inline_snapshot or "").split(",") 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s 195s self._write_files(tmp_path) 195s 195s raised_exception = None 195s with snapshot_env(): 195s with ChangeRecorder().activate() as recorder: 195s _inline_snapshot._update_flags = Flags({*flags}) 195s inline_snapshot._external.storage = ( 195s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 195s ) 195s 195s try: 195s for filename in tmp_path.glob("*.py"): 195s globals: dict[str, Any] = {} 195s print("run> pytest", filename) 195s exec( 195s compile(filename.read_text("utf-8"), filename, "exec"), 195s globals, 195s ) 195s 195s # run all test_* functions 195s for k, v in globals.items(): 195s if k.startswith("test_") and callable(v): 195s v() 195s except Exception as e: 195s traceback.print_exc() 195s raised_exception = e 195s 195s finally: 195s _inline_snapshot._active = False 195s 195s changes = [] 195s for snapshot in _inline_snapshot.snapshots.values(): 195s changes += snapshot._changes() 195s 195s snapshot_flags = {change.flag for change in changes} 195s 195s apply_all( 195s [ 195s change 195s for change in changes 195s if change.flag in _inline_snapshot._update_flags.to_set() 195s ] 195s ) 195s recorder.fix_all() 195s 195s report_output = StringIO() 195s console = Console(file=report_output) 195s 195s # TODO: add all the report output here 195s report_problems(console) 195s 195s if reported_categories is not None: 195s assert sorted(snapshot_flags) == reported_categories 195s 195s if raised_exception is not None: 195s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 195s raised_exception 195s ) 195s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 195s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot,Is 195s 195s def test_list(): 195s l=[1] 195s assert l == snapshot(l), "not equal" 195s 195s 195s run> pytest /tmp/tmp8n9b825o/test_something.py 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 195s v() 195s File "/tmp/tmp8n9b825o/test_something.py", line 5, in test_list 195s assert l == snapshot(l), "not equal" 195s ^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 195s return self == other 195s ^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 195s self._changes.append(next(it)) 195s ^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py", line 52, in assign 195s result = yield from self.value_assign(old_value, old_node, new_value) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py", line 87, in value_assign 195s result = yield from adapter.assign(old_value, old_node, new_value) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 195s new_code = self.context.file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s __________________________ test_change_function_args ___________________________ 195s 195s check_change = .w at 0x748e1a7f59e0> 195s 195s def test_change_function_args(check_change): 195s 195s > check_change( 195s "f(a,b=2)", 195s lambda source, call: [ 195s Replace( 195s flag="fix", 195s file=source, 195s node=call.args[0], 195s new_code="22", 195s old_value=0, 195s new_value=0, 195s ) 195s ], 195s snapshot("f(22,b=2)"), 195s ) 195s 195s tests/test_change.py:48: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/test_change.py:37: in w 195s cr.virtual_write() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:244: in virtual_write 195s file.virtual_write() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:141: in virtual_write 195s self.source = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = 'f(a,b=2)' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_change_function_args0/test_0.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s test: f(a,b=2) 195s __________________________________ test_enum ___________________________________ 195s 195s check_update = .w at 0x748e1a7f5440> 195s 195s def test_enum(check_update): 195s 195s assert ( 195s > check_update( 195s """ 195s from enum import Enum 195s 195s class color(Enum): 195s val="val" 195s 195s 195s assert [color.val] == snapshot() 195s 195s """, 195s flags="create", 195s ) 195s == snapshot( 195s """\ 195s 195s from enum import Enum 195s 195s class color(Enum): 195s val="val" 195s 195s 195s assert [color.val] == snapshot([color.val]) 195s 195s """ 195s ) 195s ) 195s 195s tests/test_code_repr.py:15: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_enum0/test_1.py:16: in 195s assert [color.val] == snapshot() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_enum0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s | 195s |from enum import Enum 195s | 195s |class color(Enum): 195s | val="val" 195s | 195s | 195s |assert [color.val] == snapshot() 195s | 195s _______________________ test_snapshot_generates_hasrepr ________________________ 195s 195s def test_snapshot_generates_hasrepr(): 195s 195s Example( 195s """\ 195s from inline_snapshot import snapshot 195s 195s class Thing: 195s def __repr__(self): 195s return "" 195s 195s def __eq__(self,other): 195s if not isinstance(other,Thing): 195s return NotImplemented 195s return True 195s 195s def test_thing(): 195s assert Thing() == snapshot() 195s 195s """ 195s > ).run_pytest( 195s ["--inline-snapshot=create"], 195s returncode=snapshot(0), 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s from inline_snapshot import snapshot 195s 195s from inline_snapshot import HasRepr 195s 195s class Thing: 195s def __repr__(self): 195s return "" 195s 195s def __eq__(self,other): 195s if not isinstance(other,Thing): 195s return NotImplemented 195s return True 195s 195s def test_thing(): 195s assert Thing() == snapshot(HasRepr(Thing, "")) 195s 195s \ 195s """ 195s } 195s ), 195s ).run_pytest( 195s ["--inline-snapshot=disable"], returncode=0 195s ).run_pytest( 195s returncode=0 195s ) 195s 195s tests/test_code_repr.py:63: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:297: in run_pytest 195s assert result.returncode == returncode 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '1 ' 195s filename = PosixPath('/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_code_repr.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot 195s 195s class Thing: 195s def __repr__(self): 195s return "" 195s 195s def __eq__(self,other): 195s if not isinstance(other,Thing): 195s return NotImplemented 195s return True 195s 195s def test_thing(): 195s assert Thing() == snapshot() 195s 195s 195s 195s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmpe11fkc0t 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_something.py F [100%] 195s 195s =================================== FAILURES =================================== 195s __________________________________ test_thing __________________________________ 195s 195s def test_thing(): 195s > assert Thing() == snapshot() 195s 195s test_something.py:13: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '', filename = PosixPath('/tmp/tmpe11fkc0t/test_something.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_something.py::test_thing - TypeError: CliRunner.__init__() got an... 195s ============================== 1 failed in 0.20s =============================== 195s 195s stderr: 195s 195s ____________________________ test_enum_in_dataclass ____________________________ 195s 195s check_update = .w at 0x748e1a7f56c0> 195s 195s def test_enum_in_dataclass(check_update): 195s 195s assert ( 195s > check_update( 195s """ 195s from enum import Enum 195s from dataclasses import dataclass 195s 195s class color(Enum): 195s red="red" 195s blue="blue" 195s 195s @dataclass 195s class container: 195s bg: color=color.red 195s fg: color=color.blue 195s 195s assert container(bg=color.red,fg=color.red) == snapshot() 195s 195s """, 195s flags="create", 195s ) 195s == snapshot( 195s """\ 195s 195s from enum import Enum 195s from dataclasses import dataclass 195s 195s class color(Enum): 195s red="red" 195s blue="blue" 195s 195s @dataclass 195s class container: 195s bg: color=color.red 195s fg: color=color.blue 195s 195s assert container(bg=color.red,fg=color.red) == snapshot(container(fg=color.red)) 195s 195s """ 195s ) 195s ) 195s 195s tests/test_code_repr.py:106: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_enum_in_dataclass0/test_1.py:22: in 195s assert container(bg=color.red,fg=color.red) == snapshot() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_enum_in_dataclass0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s | 195s |from enum import Enum 195s |from dataclasses import dataclass 195s | 195s |class color(Enum): 195s | red="red" 195s | blue="blue" 195s | 195s |@dataclass 195s |class container: 195s | bg: color=color.red 195s | fg: color=color.blue 195s | 195s |assert container(bg=color.red,fg=color.red) == snapshot() 195s | 195s __________________________________ test_flag ___________________________________ 195s 195s check_update = .w at 0x748e1a7f5c60> 195s 195s def test_flag(check_update): 195s 195s assert ( 195s > check_update( 195s """ 195s from enum import Flag, auto 195s 195s class Color(Flag): 195s red = auto() 195s green = auto() 195s blue = auto() 195s 195s assert Color.red | Color.blue == snapshot() 195s 195s """, 195s flags="create", 195s ) 195s == snapshot( 195s """\ 195s 195s from enum import Flag, auto 195s 195s class Color(Flag): 195s red = auto() 195s green = auto() 195s blue = auto() 195s 195s assert Color.red | Color.blue == snapshot(Color.red | Color.blue) 195s 195s """ 195s ) 195s ) 195s 195s tests/test_code_repr.py:150: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_flag0/test_1.py:17: in 195s assert Color.red | Color.blue == snapshot() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_flag0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s | 195s |from enum import Flag, auto 195s | 195s |class Color(Flag): 195s | red = auto() 195s | green = auto() 195s | blue = auto() 195s | 195s |assert Color.red | Color.blue == snapshot() 195s | 195s __________________________________ test_type ___________________________________ 195s 195s check_update = .w at 0x748e1a7f65c0> 195s 195s def test_type(check_update): 195s 195s assert ( 195s > check_update( 195s """\ 195s class Color: 195s pass 195s 195s assert [Color,int] == snapshot() 195s 195s """, 195s flags="create", 195s ) 195s == snapshot( 195s """\ 195s class Color: 195s pass 195s 195s assert [Color,int] == snapshot([Color, int]) 195s 195s """ 195s ) 195s ) 195s 195s tests/test_code_repr.py:184: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_type0/test_1.py:12: in 195s assert [Color,int] == snapshot() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_type0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |class Color: 195s | pass 195s | 195s |assert [Color,int] == snapshot() 195s | 195s ________________________________ test_qualname _________________________________ 195s 195s def test_qualname(): 195s 195s Example( 195s """\ 195s from enum import Enum 195s from inline_snapshot import snapshot 195s 195s 195s class Namespace: 195s class Color(Enum): 195s red="red" 195s 195s assert Namespace.Color.red == snapshot() 195s 195s """ 195s > ).run_inline( 195s ["--inline-snapshot=create"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s from enum import Enum 195s from inline_snapshot import snapshot 195s 195s 195s class Namespace: 195s class Color(Enum): 195s red="red" 195s 195s assert Namespace.Color.red == snapshot(Namespace.Color.red) 195s 195s \ 195s """ 195s } 195s ), 195s ).run_inline() 195s 195s tests/test_code_repr.py:221: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = ['--inline-snapshot=create'] 195s 195s def run_inline( 195s self, 195s args: list[str] = [], 195s *, 195s reported_categories: Snapshot[list[Category]] | None = None, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s raises: Snapshot[str] | None = None, 195s ) -> Example: 195s """Execute the example files in process and run every `test_*` 195s function. 195s 195s This is useful for fast test execution. 195s 195s Parameters: 195s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 195s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 195s changed_files: snapshot of files which are changed by this run. 195s raises: snapshot of the exception which is raised during the test execution. 195s It is required if your code raises an exception. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s parser = ArgumentParser() 195s 195s parser.add_argument( 195s "--inline-snapshot", 195s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 195s dest="inline_snapshot", 195s help="update specific snapshot values:\n" 195s "disable: disable the snapshot logic\n" 195s "short-report: show a short report\n" 195s "report: show a longer report with a diff report\n" 195s "review: allow to approve the changes interactive\n" 195s "create: creates snapshots which are currently not defined\n" 195s "update: update snapshots even if they are defined\n" 195s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 195s "fix: change snapshots which currently break your tests\n", 195s ) 195s parsed_args = parser.parse_args(args) 195s flags = (parsed_args.inline_snapshot or "").split(",") 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s 195s self._write_files(tmp_path) 195s 195s raised_exception = None 195s with snapshot_env(): 195s with ChangeRecorder().activate() as recorder: 195s _inline_snapshot._update_flags = Flags({*flags}) 195s inline_snapshot._external.storage = ( 195s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 195s ) 195s 195s try: 195s for filename in tmp_path.glob("*.py"): 195s globals: dict[str, Any] = {} 195s print("run> pytest", filename) 195s exec( 195s compile(filename.read_text("utf-8"), filename, "exec"), 195s globals, 195s ) 195s 195s # run all test_* functions 195s for k, v in globals.items(): 195s if k.startswith("test_") and callable(v): 195s v() 195s except Exception as e: 195s traceback.print_exc() 195s raised_exception = e 195s 195s finally: 195s _inline_snapshot._active = False 195s 195s changes = [] 195s for snapshot in _inline_snapshot.snapshots.values(): 195s changes += snapshot._changes() 195s 195s snapshot_flags = {change.flag for change in changes} 195s 195s apply_all( 195s [ 195s change 195s for change in changes 195s if change.flag in _inline_snapshot._update_flags.to_set() 195s ] 195s ) 195s recorder.fix_all() 195s 195s report_output = StringIO() 195s console = Console(file=report_output) 195s 195s # TODO: add all the report output here 195s report_problems(console) 195s 195s if reported_categories is not None: 195s assert sorted(snapshot_flags) == reported_categories 195s 195s if raised_exception is not None: 195s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 195s raised_exception 195s ) 195s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 195s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from enum import Enum 195s from inline_snapshot import snapshot 195s 195s 195s class Namespace: 195s class Color(Enum): 195s red="red" 195s 195s assert Namespace.Color.red == snapshot() 195s 195s 195s 195s run> pytest /tmp/tmpte15jh21/test_something.py 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 185, in run_inline 195s exec( 195s File "/tmp/tmpte15jh21/test_something.py", line 9, in 195s assert Namespace.Color.red == snapshot() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 195s return self == other 195s ^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 195s self._changes.append(next(it)) 195s ^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 195s new_code = self.context.file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s ______________________________ test_invalid_repr _______________________________ 195s 195s check_update = .w at 0x748e1a62afc0> 195s 195s def test_invalid_repr(check_update): 195s assert ( 195s > check_update( 195s """\ 195s class Thing: 195s def __repr__(self): 195s return "+++" 195s 195s def __eq__(self,other): 195s if not isinstance(other,Thing): 195s return NotImplemented 195s return True 195s 195s assert Thing() == snapshot() 195s """, 195s flags="create", 195s ) 195s == snapshot( 195s """\ 195s class Thing: 195s def __repr__(self): 195s return "+++" 195s 195s def __eq__(self,other): 195s if not isinstance(other,Thing): 195s return NotImplemented 195s return True 195s 195s assert Thing() == snapshot(HasRepr(Thing, "+++")) 195s """ 195s ) 195s ) 195s 195s tests/test_code_repr.py:351: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_invalid_repr0/test_1.py:18: in 195s assert Thing() == snapshot() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_invalid_repr0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |class Thing: 195s | def __repr__(self): 195s | return "+++" 195s | 195s | def __eq__(self,other): 195s | if not isinstance(other,Thing): 195s | return NotImplemented 195s | return True 195s | 195s |assert Thing() == snapshot() 195s ____________________________ test_config_pyproject _____________________________ 195s 195s def test_config_pyproject(): 195s 195s Example( 195s { 195s **file_to_trim, 195s "pyproject.toml": """ 195s [tool.inline-snapshot] 195s default-flags = ["trim"] 195s """, 195s } 195s > ).run_pytest(changed_files=trimmed_files) 195s 195s tests/test_config.py:37: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = [] 195s 195s def run_pytest( 195s self, 195s args: list[str] = [], 195s *, 195s term_columns=80, 195s env: dict[str, str] = {}, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s stderr: Snapshot[str] | None = None, 195s returncode: Snapshot[int] | None = None, 195s ) -> Example: 195s """Run pytest with the given args and env variables in an seperate 195s process. 195s 195s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 195s 195s Parameters: 195s args: pytest arguments like "--inline-snapshot=fix" 195s env: dict of environment variables 195s changed_files: snapshot of files which are changed by this run. 195s report: snapshot of the report at the end of the pytest run. 195s stderr: pytest stderr output 195s returncode: snapshot of the pytest returncode. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s self._write_files(tmp_path) 195s 195s cmd = [sys.executable, "-m", "pytest", *args] 195s 195s command_env = dict(os.environ) 195s command_env["TERM"] = "unknown" 195s command_env["COLUMNS"] = str( 195s term_columns + 1 if platform.system() == "Windows" else term_columns 195s ) 195s command_env.pop("CI", None) 195s 195s command_env.update(env) 195s 195s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 195s 195s print("run>", *cmd) 195s print("stdout:") 195s print(result.stdout.decode()) 195s print("stderr:") 195s print(result.stderr.decode()) 195s 195s if returncode is not None: 195s assert result.returncode == returncode 195s 195s if stderr is not None: 195s assert result.stderr.decode() == stderr 195s 195s if report is not None: 195s 195s report_list = [] 195s record = False 195s for line in result.stdout.decode().splitlines(): 195s line = line.strip() 195s if line.startswith("===="): 195s record = False 195s 195s if record and line: 195s report_list.append(line) 195s 195s if line.startswith("====") and "inline snapshot" in line: 195s record = True 195s 195s report_str = "\n".join(report_list) 195s 195s assert normalize(report_str) == report, repr(report_str) 195s 195s if changed_files is not None: 195s current_files = {} 195s 195s for name, content in sorted(self._read_files(tmp_path).items()): 195s if name not in self.files or self.files[name] != content: 195s current_files[name] = content 195s > assert changed_files == current_files 195s E AssertionError: assert {'test_a.py':...napshot(2)\n'} == {} 195s E 195s E Left contains 1 more item: 195s E {'test_a.py': 'from inline_snapshot import snapshot\n' 195s E '\n' 195s E 'def test_a():\n' 195s E ' assert 1 <= snapshot(1)\n' 195s E ' assert 1 == snapshot(2)\n'} 195s E Use -v to get more diff 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_a.py 195s from inline_snapshot import snapshot 195s 195s def test_a(): 195s assert 1 <= snapshot(5) 195s assert 1 == snapshot(2) 195s 195s 195s file: pyproject.toml 195s 195s [tool.inline-snapshot] 195s default-flags = ["trim"] 195s 195s 195s run> /usr/bin/python3.12 -m pytest 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmpm5c6bh6d 195s configfile: pyproject.toml 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_a.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s assert 1 <= snapshot(5) 195s > assert 1 == snapshot(2) 195s 195s test_a.py:5: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '1 ', filename = PosixPath('/tmp/tmpm5c6bh6d/test_a.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 195s 195s stderr: 195s Traceback (most recent call last): 195s File "", line 198, in _run_module_as_main 195s File "", line 88, in _run_code 195s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 195s raise SystemExit(pytest.console_main()) 195s ^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 195s code = main() 195s ^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 195s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 195s return wrap_session(config, _main) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 195s config.hook.pytest_sessionfinish( 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 195s teardown.send(result) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 195s self.config.hook.pytest_terminal_summary( 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 195s for change in snapshot._changes(): 195s ^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 195s yield from self._value._get_changes() 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s _______________________________ test_config_env ________________________________ 195s 195s def test_config_env(): 195s > Example(file_to_trim).run_pytest( 195s env={"INLINE_SNAPSHOT_DEFAULT_FLAGS": "trim"}, changed_files=trimmed_files 195s ) 195s 195s tests/test_config.py:41: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = [] 195s 195s def run_pytest( 195s self, 195s args: list[str] = [], 195s *, 195s term_columns=80, 195s env: dict[str, str] = {}, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s stderr: Snapshot[str] | None = None, 195s returncode: Snapshot[int] | None = None, 195s ) -> Example: 195s """Run pytest with the given args and env variables in an seperate 195s process. 195s 195s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 195s 195s Parameters: 195s args: pytest arguments like "--inline-snapshot=fix" 195s env: dict of environment variables 195s changed_files: snapshot of files which are changed by this run. 195s report: snapshot of the report at the end of the pytest run. 195s stderr: pytest stderr output 195s returncode: snapshot of the pytest returncode. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s self._write_files(tmp_path) 195s 195s cmd = [sys.executable, "-m", "pytest", *args] 195s 195s command_env = dict(os.environ) 195s command_env["TERM"] = "unknown" 195s command_env["COLUMNS"] = str( 195s term_columns + 1 if platform.system() == "Windows" else term_columns 195s ) 195s command_env.pop("CI", None) 195s 195s command_env.update(env) 195s 195s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 195s 195s print("run>", *cmd) 195s print("stdout:") 195s print(result.stdout.decode()) 195s print("stderr:") 195s print(result.stderr.decode()) 195s 195s if returncode is not None: 195s assert result.returncode == returncode 195s 195s if stderr is not None: 195s assert result.stderr.decode() == stderr 195s 195s if report is not None: 195s 195s report_list = [] 195s record = False 195s for line in result.stdout.decode().splitlines(): 195s line = line.strip() 195s if line.startswith("===="): 195s record = False 195s 195s if record and line: 195s report_list.append(line) 195s 195s if line.startswith("====") and "inline snapshot" in line: 195s record = True 195s 195s report_str = "\n".join(report_list) 195s 195s assert normalize(report_str) == report, repr(report_str) 195s 195s if changed_files is not None: 195s current_files = {} 195s 195s for name, content in sorted(self._read_files(tmp_path).items()): 195s if name not in self.files or self.files[name] != content: 195s current_files[name] = content 195s > assert changed_files == current_files 195s E AssertionError: assert {'test_a.py':...napshot(2)\n'} == {} 195s E 195s E Left contains 1 more item: 195s E {'test_a.py': 'from inline_snapshot import snapshot\n' 195s E '\n' 195s E 'def test_a():\n' 195s E ' assert 1 <= snapshot(1)\n' 195s E ' assert 1 == snapshot(2)\n'} 195s E Use -v to get more diff 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_a.py 195s from inline_snapshot import snapshot 195s 195s def test_a(): 195s assert 1 <= snapshot(5) 195s assert 1 == snapshot(2) 195s 195s 195s run> /usr/bin/python3.12 -m pytest 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmppdxsfewu 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_a.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s assert 1 <= snapshot(5) 195s > assert 1 == snapshot(2) 195s 195s test_a.py:5: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '1 ', filename = PosixPath('/tmp/tmppdxsfewu/test_a.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 195s 195s stderr: 195s Traceback (most recent call last): 195s File "", line 198, in _run_module_as_main 195s File "", line 88, in _run_code 195s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 195s raise SystemExit(pytest.console_main()) 195s ^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 195s code = main() 195s ^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 195s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 195s return wrap_session(config, _main) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 195s config.hook.pytest_sessionfinish( 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 195s teardown.send(result) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 195s self.config.hook.pytest_terminal_summary( 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 195s for change in snapshot._changes(): 195s ^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 195s yield from self._value._get_changes() 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s ________________________________ test_shortcuts ________________________________ 195s 195s def test_shortcuts(): 195s 195s Example( 195s { 195s **file_to_trim, 195s "pyproject.toml": """ 195s [tool.inline-snapshot.shortcuts] 195s strim=["trim"] 195s """, 195s } 195s > ).run_pytest(["--strim"], changed_files=trimmed_files) 195s 195s tests/test_config.py:56: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = ['--strim'] 195s 195s def run_pytest( 195s self, 195s args: list[str] = [], 195s *, 195s term_columns=80, 195s env: dict[str, str] = {}, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s stderr: Snapshot[str] | None = None, 195s returncode: Snapshot[int] | None = None, 195s ) -> Example: 195s """Run pytest with the given args and env variables in an seperate 195s process. 195s 195s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 195s 195s Parameters: 195s args: pytest arguments like "--inline-snapshot=fix" 195s env: dict of environment variables 195s changed_files: snapshot of files which are changed by this run. 195s report: snapshot of the report at the end of the pytest run. 195s stderr: pytest stderr output 195s returncode: snapshot of the pytest returncode. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s self._write_files(tmp_path) 195s 195s cmd = [sys.executable, "-m", "pytest", *args] 195s 195s command_env = dict(os.environ) 195s command_env["TERM"] = "unknown" 195s command_env["COLUMNS"] = str( 195s term_columns + 1 if platform.system() == "Windows" else term_columns 195s ) 195s command_env.pop("CI", None) 195s 195s command_env.update(env) 195s 195s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 195s 195s print("run>", *cmd) 195s print("stdout:") 195s print(result.stdout.decode()) 195s print("stderr:") 195s print(result.stderr.decode()) 195s 195s if returncode is not None: 195s assert result.returncode == returncode 195s 195s if stderr is not None: 195s assert result.stderr.decode() == stderr 195s 195s if report is not None: 195s 195s report_list = [] 195s record = False 195s for line in result.stdout.decode().splitlines(): 195s line = line.strip() 195s if line.startswith("===="): 195s record = False 195s 195s if record and line: 195s report_list.append(line) 195s 195s if line.startswith("====") and "inline snapshot" in line: 195s record = True 195s 195s report_str = "\n".join(report_list) 195s 195s assert normalize(report_str) == report, repr(report_str) 195s 195s if changed_files is not None: 195s current_files = {} 195s 195s for name, content in sorted(self._read_files(tmp_path).items()): 195s if name not in self.files or self.files[name] != content: 195s current_files[name] = content 195s > assert changed_files == current_files 195s E AssertionError: assert {'test_a.py':...napshot(2)\n'} == {} 195s E 195s E Left contains 1 more item: 195s E {'test_a.py': 'from inline_snapshot import snapshot\n' 195s E '\n' 195s E 'def test_a():\n' 195s E ' assert 1 <= snapshot(1)\n' 195s E ' assert 1 == snapshot(2)\n'} 195s E Use -v to get more diff 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_a.py 195s from inline_snapshot import snapshot 195s 195s def test_a(): 195s assert 1 <= snapshot(5) 195s assert 1 == snapshot(2) 195s 195s 195s file: pyproject.toml 195s 195s [tool.inline-snapshot.shortcuts] 195s strim=["trim"] 195s 195s 195s run> /usr/bin/python3.12 -m pytest --strim 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmpf9gc3rq9 195s configfile: pyproject.toml 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_a.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s assert 1 <= snapshot(5) 195s > assert 1 == snapshot(2) 195s 195s test_a.py:5: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '1 ', filename = PosixPath('/tmp/tmpf9gc3rq9/test_a.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 195s 195s stderr: 195s Traceback (most recent call last): 195s File "", line 198, in _run_module_as_main 195s File "", line 88, in _run_code 195s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 195s raise SystemExit(pytest.console_main()) 195s ^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 195s code = main() 195s ^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 195s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 195s return wrap_session(config, _main) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 195s config.hook.pytest_sessionfinish( 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 195s teardown.send(result) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 195s self.config.hook.pytest_terminal_summary( 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 195s for change in snapshot._changes(): 195s ^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 195s yield from self._value._get_changes() 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s ____________________________ test_default_shortcuts ____________________________ 195s 195s def test_default_shortcuts(): 195s 195s Example( 195s { 195s **file_to_trim, 195s "pyproject.toml": """ 195s """, 195s } 195s > ).run_pytest( 195s ["--fix"], 195s changed_files=snapshot( 195s { 195s "test_a.py": """\ 195s from inline_snapshot import snapshot 195s 195s def test_a(): 195s assert 1 <= snapshot(5) 195s assert 1 == snapshot(1) 195s """ 195s } 195s ), 195s ) 195s 195s tests/test_config.py:67: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = ['--fix'] 195s 195s def run_pytest( 195s self, 195s args: list[str] = [], 195s *, 195s term_columns=80, 195s env: dict[str, str] = {}, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s stderr: Snapshot[str] | None = None, 195s returncode: Snapshot[int] | None = None, 195s ) -> Example: 195s """Run pytest with the given args and env variables in an seperate 195s process. 195s 195s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 195s 195s Parameters: 195s args: pytest arguments like "--inline-snapshot=fix" 195s env: dict of environment variables 195s changed_files: snapshot of files which are changed by this run. 195s report: snapshot of the report at the end of the pytest run. 195s stderr: pytest stderr output 195s returncode: snapshot of the pytest returncode. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s self._write_files(tmp_path) 195s 195s cmd = [sys.executable, "-m", "pytest", *args] 195s 195s command_env = dict(os.environ) 195s command_env["TERM"] = "unknown" 195s command_env["COLUMNS"] = str( 195s term_columns + 1 if platform.system() == "Windows" else term_columns 195s ) 195s command_env.pop("CI", None) 195s 195s command_env.update(env) 195s 195s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 195s 195s print("run>", *cmd) 195s print("stdout:") 195s print(result.stdout.decode()) 195s print("stderr:") 195s print(result.stderr.decode()) 195s 195s if returncode is not None: 195s assert result.returncode == returncode 195s 195s if stderr is not None: 195s assert result.stderr.decode() == stderr 195s 195s if report is not None: 195s 195s report_list = [] 195s record = False 195s for line in result.stdout.decode().splitlines(): 195s line = line.strip() 195s if line.startswith("===="): 195s record = False 195s 195s if record and line: 195s report_list.append(line) 195s 195s if line.startswith("====") and "inline snapshot" in line: 195s record = True 195s 195s report_str = "\n".join(report_list) 195s 195s assert normalize(report_str) == report, repr(report_str) 195s 195s if changed_files is not None: 195s current_files = {} 195s 195s for name, content in sorted(self._read_files(tmp_path).items()): 195s if name not in self.files or self.files[name] != content: 195s current_files[name] = content 195s > assert changed_files == current_files 195s E AssertionError: assert {'test_a.py':...napshot(1)\n'} == {} 195s E 195s E Left contains 1 more item: 195s E {'test_a.py': 'from inline_snapshot import snapshot\n' 195s E '\n' 195s E 'def test_a():\n' 195s E ' assert 1 <= snapshot(5)\n' 195s E ' assert 1 == snapshot(1)\n'} 195s E Use -v to get more diff 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_a.py 195s from inline_snapshot import snapshot 195s 195s def test_a(): 195s assert 1 <= snapshot(5) 195s assert 1 == snapshot(2) 195s 195s 195s file: pyproject.toml 195s 195s 195s 195s run> /usr/bin/python3.12 -m pytest --fix 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmp9f_95g15 195s configfile: pyproject.toml 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_a.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s assert 1 <= snapshot(5) 195s > assert 1 == snapshot(2) 195s 195s test_a.py:5: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '1 ', filename = PosixPath('/tmp/tmp9f_95g15/test_a.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 195s 195s stderr: 195s Traceback (most recent call last): 195s File "", line 198, in _run_module_as_main 195s File "", line 88, in _run_code 195s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 195s raise SystemExit(pytest.console_main()) 195s ^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 195s code = main() 195s ^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 195s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 195s return wrap_session(config, _main) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 195s config.hook.pytest_sessionfinish( 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 195s teardown.send(result) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 195s self.config.hook.pytest_terminal_summary( 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 195s for change in snapshot._changes(): 195s ^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 195s yield from self._value._get_changes() 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s _______________________ test_compare_dirty_equals_twice ________________________ 195s 195s def test_compare_dirty_equals_twice() -> None: 195s 195s Example( 195s """ 195s from dirty_equals import IsStr 195s from inline_snapshot import snapshot 195s 195s for x in 'ab': 195s assert x == snapshot(IsStr()) 195s assert [x,5] == snapshot([IsStr(),3]) 195s assert {'a':x,'b':5} == snapshot({'a':IsStr(),'b':3}) 195s 195s """ 195s > ).run_inline( 195s ["--inline-snapshot=fix"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s 195s from dirty_equals import IsStr 195s from inline_snapshot import snapshot 195s 195s for x in 'ab': 195s assert x == snapshot(IsStr()) 195s assert [x,5] == snapshot([IsStr(),5]) 195s assert {'a':x,'b':5} == snapshot({'a':IsStr(),'b':5}) 195s 195s """ 195s } 195s ), 195s ) 195s 195s tests/test_dirty_equals.py:47: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = ['--inline-snapshot=fix'] 195s 195s def run_inline( 195s self, 195s args: list[str] = [], 195s *, 195s reported_categories: Snapshot[list[Category]] | None = None, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s raises: Snapshot[str] | None = None, 195s ) -> Example: 195s """Execute the example files in process and run every `test_*` 195s function. 195s 195s This is useful for fast test execution. 195s 195s Parameters: 195s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 195s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 195s changed_files: snapshot of files which are changed by this run. 195s raises: snapshot of the exception which is raised during the test execution. 195s It is required if your code raises an exception. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s parser = ArgumentParser() 195s 195s parser.add_argument( 195s "--inline-snapshot", 195s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 195s dest="inline_snapshot", 195s help="update specific snapshot values:\n" 195s "disable: disable the snapshot logic\n" 195s "short-report: show a short report\n" 195s "report: show a longer report with a diff report\n" 195s "review: allow to approve the changes interactive\n" 195s "create: creates snapshots which are currently not defined\n" 195s "update: update snapshots even if they are defined\n" 195s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 195s "fix: change snapshots which currently break your tests\n", 195s ) 195s parsed_args = parser.parse_args(args) 195s flags = (parsed_args.inline_snapshot or "").split(",") 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s 195s self._write_files(tmp_path) 195s 195s raised_exception = None 195s with snapshot_env(): 195s with ChangeRecorder().activate() as recorder: 195s _inline_snapshot._update_flags = Flags({*flags}) 195s inline_snapshot._external.storage = ( 195s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 195s ) 195s 195s try: 195s for filename in tmp_path.glob("*.py"): 195s globals: dict[str, Any] = {} 195s print("run> pytest", filename) 195s exec( 195s compile(filename.read_text("utf-8"), filename, "exec"), 195s globals, 195s ) 195s 195s # run all test_* functions 195s for k, v in globals.items(): 195s if k.startswith("test_") and callable(v): 195s v() 195s except Exception as e: 195s traceback.print_exc() 195s raised_exception = e 195s 195s finally: 195s _inline_snapshot._active = False 195s 195s changes = [] 195s for snapshot in _inline_snapshot.snapshots.values(): 195s changes += snapshot._changes() 195s 195s snapshot_flags = {change.flag for change in changes} 195s 195s apply_all( 195s [ 195s change 195s for change in changes 195s if change.flag in _inline_snapshot._update_flags.to_set() 195s ] 195s ) 195s recorder.fix_all() 195s 195s report_output = StringIO() 195s console = Console(file=report_output) 195s 195s # TODO: add all the report output here 195s report_problems(console) 195s 195s if reported_categories is not None: 195s assert sorted(snapshot_flags) == reported_categories 195s 195s if raised_exception is not None: 195s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 195s raised_exception 195s ) 195s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 195s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s 195s from dirty_equals import IsStr 195s from inline_snapshot import snapshot 195s 195s for x in 'ab': 195s assert x == snapshot(IsStr()) 195s assert [x,5] == snapshot([IsStr(),3]) 195s assert {'a':x,'b':5} == snapshot({'a':IsStr(),'b':3}) 195s 195s 195s 195s run> pytest /tmp/tmp8grgli29/test_something.py 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 185, in run_inline 195s exec( 195s File "/tmp/tmp8grgli29/test_something.py", line 7, in 195s assert [x,5] == snapshot([IsStr(),3]) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 195s return self == other 195s ^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 195s self._changes.append(next(it)) 195s ^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py", line 79, in assign 195s v = yield from self.get_adapter( 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 195s new_code = self.context.file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s _____________________ test_dirty_equals_with_changing_args _____________________ 195s 195s def test_dirty_equals_with_changing_args() -> None: 195s 195s Example( 195s """\ 195s from dirty_equals import IsInt 195s from inline_snapshot import snapshot 195s 195s def test_number(): 195s 195s for i in range(5): 195s assert ["a",i] == snapshot(["e",IsInt(gt=i-1,lt=i+1)]) 195s 195s """ 195s > ).run_inline( 195s ["--inline-snapshot=fix"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s from dirty_equals import IsInt 195s from inline_snapshot import snapshot 195s 195s def test_number(): 195s 195s for i in range(5): 195s assert ["a",i] == snapshot(["a",IsInt(gt=i-1,lt=i+1)]) 195s 195s """ 195s } 195s ), 195s ) 195s 195s tests/test_dirty_equals.py:138: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = ['--inline-snapshot=fix'] 195s 195s def run_inline( 195s self, 195s args: list[str] = [], 195s *, 195s reported_categories: Snapshot[list[Category]] | None = None, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s raises: Snapshot[str] | None = None, 195s ) -> Example: 195s """Execute the example files in process and run every `test_*` 195s function. 195s 195s This is useful for fast test execution. 195s 195s Parameters: 195s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 195s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 195s changed_files: snapshot of files which are changed by this run. 195s raises: snapshot of the exception which is raised during the test execution. 195s It is required if your code raises an exception. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s parser = ArgumentParser() 195s 195s parser.add_argument( 195s "--inline-snapshot", 195s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 195s dest="inline_snapshot", 195s help="update specific snapshot values:\n" 195s "disable: disable the snapshot logic\n" 195s "short-report: show a short report\n" 195s "report: show a longer report with a diff report\n" 195s "review: allow to approve the changes interactive\n" 195s "create: creates snapshots which are currently not defined\n" 195s "update: update snapshots even if they are defined\n" 195s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 195s "fix: change snapshots which currently break your tests\n", 195s ) 195s parsed_args = parser.parse_args(args) 195s flags = (parsed_args.inline_snapshot or "").split(",") 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s 195s self._write_files(tmp_path) 195s 195s raised_exception = None 195s with snapshot_env(): 195s with ChangeRecorder().activate() as recorder: 195s _inline_snapshot._update_flags = Flags({*flags}) 195s inline_snapshot._external.storage = ( 195s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 195s ) 195s 195s try: 195s for filename in tmp_path.glob("*.py"): 195s globals: dict[str, Any] = {} 195s print("run> pytest", filename) 195s exec( 195s compile(filename.read_text("utf-8"), filename, "exec"), 195s globals, 195s ) 195s 195s # run all test_* functions 195s for k, v in globals.items(): 195s if k.startswith("test_") and callable(v): 195s v() 195s except Exception as e: 195s traceback.print_exc() 195s raised_exception = e 195s 195s finally: 195s _inline_snapshot._active = False 195s 195s changes = [] 195s for snapshot in _inline_snapshot.snapshots.values(): 195s changes += snapshot._changes() 195s 195s snapshot_flags = {change.flag for change in changes} 195s 195s apply_all( 195s [ 195s change 195s for change in changes 195s if change.flag in _inline_snapshot._update_flags.to_set() 195s ] 195s ) 195s recorder.fix_all() 195s 195s report_output = StringIO() 195s console = Console(file=report_output) 195s 195s # TODO: add all the report output here 195s report_problems(console) 195s 195s if reported_categories is not None: 195s assert sorted(snapshot_flags) == reported_categories 195s 195s if raised_exception is not None: 195s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 195s raised_exception 195s ) 195s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 195s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from dirty_equals import IsInt 195s from inline_snapshot import snapshot 195s 195s def test_number(): 195s 195s for i in range(5): 195s assert ["a",i] == snapshot(["e",IsInt(gt=i-1,lt=i+1)]) 195s 195s 195s 195s run> pytest /tmp/tmpzo4nwy47/test_something.py 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 195s v() 195s File "/tmp/tmpzo4nwy47/test_something.py", line 7, in test_number 195s assert ["a",i] == snapshot(["e",IsInt(gt=i-1,lt=i+1)]) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 195s return self == other 195s ^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 195s self._changes.append(next(it)) 195s ^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py", line 79, in assign 195s v = yield from self.get_adapter( 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 195s new_code = self.context.file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s _________________________________ test_example _________________________________ 195s 195s def test_example(): 195s 195s e = Example( 195s { 195s "test_a.py": """ 195s from inline_snapshot import snapshot 195s 195s def test_a(): 195s assert 1==snapshot(2) 195s """, 195s "test_b.py": "1+1", 195s }, 195s ) 195s 195s e.run_pytest( 195s ["--inline-snapshot=create,fix"], 195s ) 195s 195s > e.run_inline( 195s ["--inline-snapshot=fix"], 195s reported_categories=snapshot(["fix"]), 195s ).run_inline( 195s ["--inline-snapshot=fix"], 195s changed_files=snapshot({}), 195s ) 195s 195s tests/test_example.py:23: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = ['--inline-snapshot=fix'] 195s 195s def run_inline( 195s self, 195s args: list[str] = [], 195s *, 195s reported_categories: Snapshot[list[Category]] | None = None, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s raises: Snapshot[str] | None = None, 195s ) -> Example: 195s """Execute the example files in process and run every `test_*` 195s function. 195s 195s This is useful for fast test execution. 195s 195s Parameters: 195s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 195s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 195s changed_files: snapshot of files which are changed by this run. 195s raises: snapshot of the exception which is raised during the test execution. 195s It is required if your code raises an exception. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s parser = ArgumentParser() 195s 195s parser.add_argument( 195s "--inline-snapshot", 195s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 195s dest="inline_snapshot", 195s help="update specific snapshot values:\n" 195s "disable: disable the snapshot logic\n" 195s "short-report: show a short report\n" 195s "report: show a longer report with a diff report\n" 195s "review: allow to approve the changes interactive\n" 195s "create: creates snapshots which are currently not defined\n" 195s "update: update snapshots even if they are defined\n" 195s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 195s "fix: change snapshots which currently break your tests\n", 195s ) 195s parsed_args = parser.parse_args(args) 195s flags = (parsed_args.inline_snapshot or "").split(",") 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s 195s self._write_files(tmp_path) 195s 195s raised_exception = None 195s with snapshot_env(): 195s with ChangeRecorder().activate() as recorder: 195s _inline_snapshot._update_flags = Flags({*flags}) 195s inline_snapshot._external.storage = ( 195s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 195s ) 195s 195s try: 195s for filename in tmp_path.glob("*.py"): 195s globals: dict[str, Any] = {} 195s print("run> pytest", filename) 195s exec( 195s compile(filename.read_text("utf-8"), filename, "exec"), 195s globals, 195s ) 195s 195s # run all test_* functions 195s for k, v in globals.items(): 195s if k.startswith("test_") and callable(v): 195s v() 195s except Exception as e: 195s traceback.print_exc() 195s raised_exception = e 195s 195s finally: 195s _inline_snapshot._active = False 195s 195s changes = [] 195s for snapshot in _inline_snapshot.snapshots.values(): 195s changes += snapshot._changes() 195s 195s snapshot_flags = {change.flag for change in changes} 195s 195s apply_all( 195s [ 195s change 195s for change in changes 195s if change.flag in _inline_snapshot._update_flags.to_set() 195s ] 195s ) 195s recorder.fix_all() 195s 195s report_output = StringIO() 195s console = Console(file=report_output) 195s 195s # TODO: add all the report output here 195s report_problems(console) 195s 195s if reported_categories is not None: 195s > assert sorted(snapshot_flags) == reported_categories 195s E AssertionError: assert [] == ['fix'] 195s E 195s E Right contains one more item: 'fix' 195s E Use -v to get more diff 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:223: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_a.py 195s 195s from inline_snapshot import snapshot 195s 195s def test_a(): 195s assert 1==snapshot(2) 195s 195s 195s file: test_b.py 195s 1+1 195s 195s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create,fix 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmp7x5hejg3 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_a.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s > assert 1==snapshot(2) 195s 195s test_a.py:5: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '1 ', filename = PosixPath('/tmp/tmp7x5hejg3/test_a.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 195s ============================== 1 failed in 0.22s =============================== 195s 195s stderr: 195s 195s file: test_b.py 195s 1+1 195s 195s file: test_a.py 195s 195s from inline_snapshot import snapshot 195s 195s def test_a(): 195s assert 1==snapshot(2) 195s 195s 195s run> pytest /tmp/tmpe8mcu2hw/test_b.py 195s run> pytest /tmp/tmpe8mcu2hw/test_a.py 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 195s v() 195s File "/tmp/tmpe8mcu2hw/test_a.py", line 5, in test_a 195s assert 1==snapshot(2) 195s ^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 195s return self == other 195s ^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 195s self._changes.append(next(it)) 195s ^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 195s new_code = self.context.file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s __________________________________ test_basic __________________________________ 195s 195s check_update = .w at 0x748e1a628860> 195s 195s def test_basic(check_update): 195s > assert check_update( 195s "assert outsource('text') == snapshot()", flags="create" 195s ) == snapshot( 195s "assert outsource('text') == snapshot(external(\"982d9e3eb996*.txt\"))" 195s ) 195s 195s tests/test_external.py:12: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_basic0/test_1.py:9: in 195s assert outsource('text') == snapshot() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_basic0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert outsource('text') == snapshot() 195s _________________________________ test_persist _________________________________ 195s 195s project = .Project object at 0x748e1a3d6ab0> 195s 195s def test_persist(project): 195s 195s project.setup( 195s """\ 195s from inline_snapshot import external 195s 195s def test_something(): 195s assert "hello" == snapshot(external("bbbbb*.txt")) 195s assert 2 == snapshot(1+1) 195s """ 195s ) 195s 195s result = project.run("--inline-snapshot=update") 195s 195s assert project.storage() == snapshot([]) 195s 195s > assert project.source == snapshot( 195s """\ 195s from inline_snapshot import external 195s 195s def test_something(): 195s assert "hello" == snapshot(external("bbbbb*.txt")) 195s assert 2 == snapshot(2) 195s """ 195s ) 195s 195s /tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_external.py:78: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '"""\\\nfrom inline_snapshot import external\n\ndef test_something():\n assert "hello" == snapshot(external("bbbbb*.txt"))\n assert 2 == snapshot(1+1)\n"""' 195s filename = PosixPath('/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_external.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s write code: 195s # äöß 🐍 195s from inline_snapshot import snapshot 195s from inline_snapshot import outsource 195s from inline_snapshot import external 195s 195s def test_something(): 195s assert "hello" == snapshot(external("bbbbb*.txt")) 195s assert 2 == snapshot(1+1) 195s 195s running: pytest --inline-snapshot=update 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_persist0 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_persist0 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_file.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ________________________________ test_something ________________________________ 195s 195s def test_something(): 195s > assert "hello" == snapshot(external("bbbbb*.txt")) 195s 195s test_file.py:7: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = "'hello'" 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_persist0/test_file.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_file.py::test_something - TypeError: CliRunner.__init__() got an ... 195s ============================== 1 failed in 0.26s =============================== 195s _________________________ test_pytest_compare_external _________________________ 195s 195s project = .Project object at 0x748e1a1ca270> 195s 195s def test_pytest_compare_external(project): 195s project.setup( 195s """\ 195s from inline_snapshot import external 195s 195s def test_a(): 195s assert outsource("test") == snapshot( 195s external("9f86d081884c*.txt") 195s ) 195s 195s assert outsource("test2") == snapshot( 195s external("9f86d081884c*.txt") 195s ) 195s """ 195s ) 195s 195s result = project.run() 195s 195s > assert result.errorLines() == snapshot( 195s """\ 195s > assert outsource("test2") == snapshot( 195s E AssertionError: assert 'test2' == 'test' 195s E ⏎ 195s E - test 195s E + test2 195s E ? + 195s """ 195s ) 195s 195s /tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_external.py:123: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '"""\\\n> assert outsource("test2") == snapshot(\n> runner = CliRunner(mix_stderr=False)\nE TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\n"""' 195s filename = PosixPath('/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_external.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s write code: 195s # äöß 🐍 195s from inline_snapshot import snapshot 195s from inline_snapshot import outsource 195s from inline_snapshot import external 195s 195s def test_a(): 195s assert outsource("test") == snapshot( 195s external("9f86d081884c*.txt") 195s ) 195s 195s assert outsource("test2") == snapshot( 195s external("9f86d081884c*.txt") 195s ) 195s 195s running: pytest 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external0 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external0 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_file.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s assert outsource("test") == snapshot( 195s external("9f86d081884c*.txt") 195s ) 195s 195s > assert outsource("test2") == snapshot( 195s external("9f86d081884c*.txt") 195s ) 195s 195s test_file.py:11: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = 'external ("60303ae22b99*.txt")' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external0/test_file.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 195s ============================== 1 failed in 0.28s =============================== 195s ______________________ test_pytest_compare_external_bytes ______________________ 195s 195s project = .Project object at 0x748e1a1cbfb0> 195s 195s def test_pytest_compare_external_bytes(project): 195s project.setup( 195s """\ 195s from inline_snapshot import external 195s 195s def test_a(): 195s assert outsource(b"test") == snapshot( 195s external("9f86d081884c*.bin") 195s ) 195s 195s assert outsource(b"test2") == snapshot( 195s external("9f86d081884c*.bin") 195s ) 195s """ 195s ) 195s 195s result = project.run() 195s 195s > assert result.errorLines() == snapshot( 195s """\ 195s > assert outsource(b"test2") == snapshot( 195s E AssertionError: assert b'test2' == b'test' 195s E ⏎ 195s E Use -v to get more diff 195s """ 195s ) 195s 195s /tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_external.py:153: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s 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"""' 195s filename = PosixPath('/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_external.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s write code: 195s # äöß 🐍 195s from inline_snapshot import snapshot 195s from inline_snapshot import outsource 195s from inline_snapshot import external 195s 195s def test_a(): 195s assert outsource(b"test") == snapshot( 195s external("9f86d081884c*.bin") 195s ) 195s 195s assert outsource(b"test2") == snapshot( 195s external("9f86d081884c*.bin") 195s ) 195s 195s running: pytest 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external_bytes0 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external_bytes0 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_file.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s assert outsource(b"test") == snapshot( 195s external("9f86d081884c*.bin") 195s ) 195s 195s > assert outsource(b"test2") == snapshot( 195s external("9f86d081884c*.bin") 195s ) 195s 195s test_file.py:11: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = 'external ("60303ae22b99*.bin")' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external_bytes0/test_file.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 195s ============================== 1 failed in 0.28s =============================== 195s _____________________ test_pytest_existing_external_import _____________________ 195s 195s project = .Project object at 0x748e1a1cb500> 195s 195s def test_pytest_existing_external_import(project): 195s project.setup( 195s """\ 195s from inline_snapshot import external 195s 195s def test_a(): 195s assert outsource("test") == snapshot() 195s """ 195s ) 195s 195s result = project.run("--inline-snapshot=create") 195s 195s > assert project.source == snapshot( 195s """\ 195s from inline_snapshot import external 195s 195s def test_a(): 195s assert outsource("test") == snapshot(external("9f86d081884c*.txt")) 195s """ 195s ) 195s 195s /tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_external.py:175: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '"""\\\nfrom inline_snapshot import external\n\ndef test_a():\n assert outsource("test") == snapshot()\n"""' 195s filename = PosixPath('/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_external.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s write code: 195s # äöß 🐍 195s from inline_snapshot import snapshot 195s from inline_snapshot import outsource 195s from inline_snapshot import external 195s 195s def test_a(): 195s assert outsource("test") == snapshot() 195s 195s running: pytest --inline-snapshot=create 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_existing_external_import0 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_existing_external_import0 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_file.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s > assert outsource("test") == snapshot() 195s 195s test_file.py:7: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_existing_external_import0/test_file.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 195s ============================== 1 failed in 0.25s =============================== 195s __________________________ test_pytest_trim_external ___________________________ 195s 195s project = .Project object at 0x748e1a1f7080> 195s 195s def test_pytest_trim_external(project): 195s project.setup( 195s """\ 195s def test_a(): 195s assert outsource("test") == snapshot() 195s 195s # split 195s 195s assert outsource("test2") == snapshot() 195s """ 195s ) 195s 195s project.run("--inline-snapshot=create") 195s 195s > assert project.storage() == snapshot( 195s [ 195s "60303ae22b998861bce3b28f33eec1be758a213c86c93c076dbe9f558c11c752.txt", 195s "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08.txt", 195s ] 195s ) 195s 195s /tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_external.py:199: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = "'9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08-new.txt'" 195s filename = PosixPath('/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_external.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s write code: 195s # äöß 🐍 195s from inline_snapshot import snapshot 195s from inline_snapshot import outsource 195s 195s 195s def test_a(): 195s assert outsource("test") == snapshot() 195s 195s # split 195s 195s assert outsource("test2") == snapshot() 195s 195s running: pytest --inline-snapshot=create 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_trim_external0 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_trim_external0 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_file.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s > assert outsource("test") == snapshot() 195s 195s test_file.py:7: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_trim_external0/test_file.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 195s ============================== 1 failed in 0.25s =============================== 195s ___________________________ test_pytest_new_external ___________________________ 195s 195s project = .Project object at 0x748e1a1f6e70> 195s 195s def test_pytest_new_external(project): 195s project.setup( 195s """\ 195s def test_a(): 195s assert outsource("test") == snapshot() 195s """ 195s ) 195s project.run() 195s 195s assert project.storage() == snapshot( 195s ["9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08-new.txt"] 195s ) 195s 195s project.run("--inline-snapshot=create") 195s 195s > assert project.storage() == snapshot( 195s ["9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08.txt"] 195s ) 195s 195s /tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_external.py:255: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = "'9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08-new.txt'" 195s filename = PosixPath('/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_external.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s write code: 195s # äöß 🐍 195s from inline_snapshot import snapshot 195s from inline_snapshot import outsource 195s 195s 195s def test_a(): 195s assert outsource("test") == snapshot() 195s 195s running: pytest 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_file.py FE [100%] 195s 195s ==================================== ERRORS ==================================== 195s _________________________ ERROR at teardown of test_a __________________________ 195s your snapshot is missing one value. 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s > assert outsource("test") == snapshot() 195s 195s test_file.py:7: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0/test_file.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 195s ERROR test_file.py::test_a - Failed: your snapshot is missing one value. 195s ========================== 1 failed, 1 error in 0.27s ========================== 195s running: pytest --inline-snapshot=create 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_file.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s > assert outsource("test") == snapshot() 195s 195s test_file.py:7: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0/test_file.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 195s ============================== 1 failed in 0.25s =============================== 195s ________________________ test_pytest_config_hash_length ________________________ 195s 195s project = .Project object at 0x748e1a0bb830> 195s 195s def test_pytest_config_hash_length(project): 195s project.setup( 195s """\ 195s def test_a(): 195s assert outsource("test") == snapshot() 195s """ 195s ) 195s project.run("--inline-snapshot=create") 195s default_result = project.source 195s 195s # default config 195s project.pyproject( 195s """ 195s [tool.inline-snapshot] 195s """ 195s ) 195s project.run("--inline-snapshot=create") 195s assert default_result == project.source 195s 195s # set hash_length 195s project.pyproject( 195s """ 195s [tool.inline-snapshot] 195s hash-length=5 195s """ 195s ) 195s project.run("--inline-snapshot=create") 195s > assert project.source == snapshot( 195s """\ 195s from inline_snapshot import external 195s 195s 195s def test_a(): 195s assert outsource("test") == snapshot(external("9f86d081884c*.txt")) 195s """ 195s ) 195s 195s /tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_external.py:287: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '"""\\\ndef test_a():\n assert outsource("test") == snapshot()\n"""' 195s filename = PosixPath('/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_external.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s write code: 195s # äöß 🐍 195s from inline_snapshot import snapshot 195s from inline_snapshot import outsource 195s 195s 195s def test_a(): 195s assert outsource("test") == snapshot() 195s 195s running: pytest --inline-snapshot=create 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_file.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s > assert outsource("test") == snapshot() 195s 195s test_file.py:7: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0/test_file.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 195s ============================== 1 failed in 0.25s =============================== 195s running: pytest --inline-snapshot=create 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 195s configfile: pyproject.toml 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_file.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s > assert outsource("test") == snapshot() 195s 195s test_file.py:7: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0/test_file.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 195s ============================== 1 failed in 0.26s =============================== 195s running: pytest --inline-snapshot=create 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 195s configfile: pyproject.toml 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_file.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s > assert outsource("test") == snapshot() 195s 195s test_file.py:7: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0/test_file.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 195s ============================== 1 failed in 0.25s =============================== 195s _______________________________ test_no_imports ________________________________ 195s 195s project = .Project object at 0x748e1a090830> 195s 195s def test_no_imports(project): 195s project.setup( 195s """\ 195s # no imports 195s 195s def test_something(): 195s from inline_snapshot import outsource,snapshot 195s assert outsource("test") == snapshot() 195s test_something() 195s """ 195s ) 195s 195s result = project.run("--inline-snapshot=create") 195s 195s > result.assert_outcomes(passed=1) 195s E AssertionError: assert {'errors': 1,...pped': 0, ...} == {'errors': 0,...pped': 0, ...} 195s E 195s E Omitting 4 identical items, use -vv to show 195s E Differing items: 195s E {'errors': 1} != {'errors': 0} 195s E {'passed': 0} != {'passed': 1} 195s E Use -v to get more diff 195s 195s /tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_external.py:340: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s write code: 195s # äöß 🐍 195s 195s 195s # no imports 195s 195s def test_something(): 195s from inline_snapshot import outsource,snapshot 195s assert outsource("test") == snapshot() 195s test_something() 195s 195s running: pytest --inline-snapshot=create 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_no_imports0 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_no_imports0 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 0 items / 1 error 195s 195s ==================================== ERRORS ==================================== 195s ________________________ ERROR collecting test_file.py _________________________ 195s test_file.py:9: in 195s test_something() 195s test_file.py:8: in test_something 195s assert outsource("test") == snapshot() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 195s runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s ERROR test_file.py - TypeError: CliRunner.__init__() got an unexpected keywor... 195s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 195s =============================== 1 error in 0.23s =============================== 195s _____________________________ test_ensure_imports ______________________________ 195s 195s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_ensure_imports0') 195s 195s def test_ensure_imports(tmp_path): 195s file = tmp_path / "file.py" 195s file.write_text( 195s """\ 195s from os import environ 195s from os import getcwd 195s """, 195s "utf-8", 195s ) 195s 195s > with apply_changes(): 195s 195s tests/test_external.py:372: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3.12/contextlib.py:144: in __exit__ 195s next(self.gen) 195s tests/utils.py:32: in apply_changes 195s recorder.fix_all() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 195s file.rewrite() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 195s new_code = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = 'from os import environ\nfrom os import getcwd\n' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_ensure_imports0/file.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s _______________________ test_ensure_imports_with_comment _______________________ 195s 195s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_ensure_imports_with_comme0') 195s 195s def test_ensure_imports_with_comment(tmp_path): 195s file = tmp_path / "file.py" 195s file.write_text( 195s """\ 195s from os import environ # comment 195s """, 195s "utf-8", 195s ) 195s 195s > with apply_changes(): 195s 195s tests/test_external.py:394: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3.12/contextlib.py:144: in __exit__ 195s next(self.gen) 195s tests/utils.py:32: in apply_changes 195s recorder.fix_all() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 195s file.rewrite() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 195s new_code = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = 'from os import environ # comment\n' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_ensure_imports_with_comme0/file.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ______________________________ test_new_externals ______________________________ 195s 195s project = .Project object at 0x748e1a093740> 195s 195s def test_new_externals(project): 195s project.setup( 195s """ 195s 195s def test_something(): 195s outsource("blub") 195s 195s assert outsource("foo") == snapshot() 195s 195s """ 195s ) 195s 195s project.run("--inline-snapshot=create") 195s 195s > assert project.storage() == snapshot( 195s [ 195s "2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae.txt", 195s "8dc140e6fe831481a2005ae152ffe32a9974aa92a260dfbac780d6a87154bb0b-new.txt", 195s ] 195s ) 195s 195s /tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_external.py:420: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = "'2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae-new.txt'" 195s filename = PosixPath('/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_external.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s write code: 195s # äöß 🐍 195s from inline_snapshot import snapshot 195s from inline_snapshot import outsource 195s 195s 195s 195s 195s def test_something(): 195s outsource("blub") 195s 195s assert outsource("foo") == snapshot() 195s 195s 195s running: pytest --inline-snapshot=create 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_new_externals0 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_new_externals0 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_file.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ________________________________ test_something ________________________________ 195s 195s def test_something(): 195s outsource("blub") 195s 195s > assert outsource("foo") == snapshot() 195s 195s test_file.py:11: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_new_externals0/test_file.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_file.py::test_something - TypeError: CliRunner.__init__() got an ... 195s ============================== 1 failed in 0.26s =============================== 195s _________________________ test_black_formatting_error __________________________ 195s 195s mocker = 195s 195s def test_black_formatting_error(mocker): 195s mocker.patch.object(CliRunner, "invoke", return_value=SimpleNamespace(exit_code=1)) 195s 195s Example( 195s """\ 195s from inline_snapshot import snapshot 195s 195s def test_something(): 195s assert 1==snapshot() 195s assert 1==snapshot(2) 195s assert list(range(20)) == snapshot() 195s """ 195s > ).run_inline( 195s ["--inline-snapshot=fix,create"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s from inline_snapshot import snapshot 195s 195s def test_something(): 195s assert 1==snapshot(1) 195s assert 1==snapshot(1) 195s 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 ]) 195s """ 195s } 195s ), 195s report=snapshot( 195s """\ 195s ----------------------------------- Problems ----------------------------------- 195s black could not format your code, which might be caused by this issue: 195s https://github.com/15r10nk/inline-snapshot/issues/138 195s 195s """ 195s ), 195s ) 195s 195s tests/test_formating.py:24: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = ['--inline-snapshot=fix,create'] 195s 195s def run_inline( 195s self, 195s args: list[str] = [], 195s *, 195s reported_categories: Snapshot[list[Category]] | None = None, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s raises: Snapshot[str] | None = None, 195s ) -> Example: 195s """Execute the example files in process and run every `test_*` 195s function. 195s 195s This is useful for fast test execution. 195s 195s Parameters: 195s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 195s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 195s changed_files: snapshot of files which are changed by this run. 195s raises: snapshot of the exception which is raised during the test execution. 195s It is required if your code raises an exception. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s parser = ArgumentParser() 195s 195s parser.add_argument( 195s "--inline-snapshot", 195s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 195s dest="inline_snapshot", 195s help="update specific snapshot values:\n" 195s "disable: disable the snapshot logic\n" 195s "short-report: show a short report\n" 195s "report: show a longer report with a diff report\n" 195s "review: allow to approve the changes interactive\n" 195s "create: creates snapshots which are currently not defined\n" 195s "update: update snapshots even if they are defined\n" 195s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 195s "fix: change snapshots which currently break your tests\n", 195s ) 195s parsed_args = parser.parse_args(args) 195s flags = (parsed_args.inline_snapshot or "").split(",") 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s 195s self._write_files(tmp_path) 195s 195s raised_exception = None 195s with snapshot_env(): 195s with ChangeRecorder().activate() as recorder: 195s _inline_snapshot._update_flags = Flags({*flags}) 195s inline_snapshot._external.storage = ( 195s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 195s ) 195s 195s try: 195s for filename in tmp_path.glob("*.py"): 195s globals: dict[str, Any] = {} 195s print("run> pytest", filename) 195s exec( 195s compile(filename.read_text("utf-8"), filename, "exec"), 195s globals, 195s ) 195s 195s # run all test_* functions 195s for k, v in globals.items(): 195s if k.startswith("test_") and callable(v): 195s v() 195s except Exception as e: 195s traceback.print_exc() 195s raised_exception = e 195s 195s finally: 195s _inline_snapshot._active = False 195s 195s changes = [] 195s for snapshot in _inline_snapshot.snapshots.values(): 195s changes += snapshot._changes() 195s 195s snapshot_flags = {change.flag for change in changes} 195s 195s apply_all( 195s [ 195s change 195s for change in changes 195s if change.flag in _inline_snapshot._update_flags.to_set() 195s ] 195s ) 195s recorder.fix_all() 195s 195s report_output = StringIO() 195s console = Console(file=report_output) 195s 195s # TODO: add all the report output here 195s report_problems(console) 195s 195s if reported_categories is not None: 195s assert sorted(snapshot_flags) == reported_categories 195s 195s if raised_exception is not None: 195s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 195s raised_exception 195s ) 195s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 195s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot 195s 195s def test_something(): 195s assert 1==snapshot() 195s assert 1==snapshot(2) 195s assert list(range(20)) == snapshot() 195s 195s 195s run> pytest /tmp/tmpv4aenias/test_something.py 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 195s v() 195s File "/tmp/tmpv4aenias/test_something.py", line 4, in test_something 195s assert 1==snapshot() 195s ^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 195s return self == other 195s ^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 195s self._changes.append(next(it)) 195s ^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 195s new_code = self.context.file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s _______________________________ test_fstring_139 _______________________________ 195s 195s def test_fstring_139(): 195s Example( 195s """ 195s from inline_snapshot import snapshot 195s snapshot(f'') 195s snapshot(rf'') 195s snapshot(Rf'') 195s snapshot(F'') 195s snapshot(rF'') 195s snapshot(RF'') 195s 195s 195s def test_a(): 195s return None 195s """ 195s > ).run_pytest(returncode=0) 195s 195s tests/test_formating.py:64: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = [] 195s 195s def run_pytest( 195s self, 195s args: list[str] = [], 195s *, 195s term_columns=80, 195s env: dict[str, str] = {}, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s stderr: Snapshot[str] | None = None, 195s returncode: Snapshot[int] | None = None, 195s ) -> Example: 195s """Run pytest with the given args and env variables in an seperate 195s process. 195s 195s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 195s 195s Parameters: 195s args: pytest arguments like "--inline-snapshot=fix" 195s env: dict of environment variables 195s changed_files: snapshot of files which are changed by this run. 195s report: snapshot of the report at the end of the pytest run. 195s stderr: pytest stderr output 195s returncode: snapshot of the pytest returncode. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s self._write_files(tmp_path) 195s 195s cmd = [sys.executable, "-m", "pytest", *args] 195s 195s command_env = dict(os.environ) 195s command_env["TERM"] = "unknown" 195s command_env["COLUMNS"] = str( 195s term_columns + 1 if platform.system() == "Windows" else term_columns 195s ) 195s command_env.pop("CI", None) 195s 195s command_env.update(env) 195s 195s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 195s 195s print("run>", *cmd) 195s print("stdout:") 195s print(result.stdout.decode()) 195s print("stderr:") 195s print(result.stderr.decode()) 195s 195s if returncode is not None: 195s > assert result.returncode == returncode 195s E AssertionError: assert 1 == 0 195s 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 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:297: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s 195s from inline_snapshot import snapshot 195s snapshot(f'') 195s snapshot(rf'') 195s snapshot(Rf'') 195s snapshot(F'') 195s snapshot(rF'') 195s snapshot(RF'') 195s 195s 195s def test_a(): 195s return None 195s 195s 195s run> /usr/bin/python3.12 -m pytest 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmpu1sr77nc 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_something.py . [100%] 195s =============================== inline snapshot ================================ 195s 195s stderr: 195s Traceback (most recent call last): 195s File "", line 198, in _run_module_as_main 195s File "", line 88, in _run_code 195s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 195s raise SystemExit(pytest.console_main()) 195s ^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 195s code = main() 195s ^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 195s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 195s return wrap_session(config, _main) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 195s config.hook.pytest_sessionfinish( 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 195s teardown.send(result) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 195s self.config.hook.pytest_terminal_summary( 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 195s for change in snapshot._changes(): 195s ^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 195s yield from self._value._get_changes() 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 218, in _get_changes 195s yield from handle(self._ast_node, self._old_value) 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 206, in handle 195s new_code = self._file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s _______________ test_generic[executing] [assert 4 == snapshot()] _______________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_1.py:9: in 195s assert 4 == snapshot() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 4 == snapshot() 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________ test_generic[executing] [assert 4 == snapshot({})[0]] _____________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_2.py:9: in 195s assert 4 == snapshot({})[0] 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_2.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 4 == snapshot({})[0] 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic[executing] [assert 4 == snapshot(5)] _______________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_3.py:9: in 195s assert 4 == snapshot(5) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_3.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 4 == snapshot(5) 195s ------------------------------ Captured log call ------------------------------- 195s 195s __________ test_generic[executing] [assert 4 == snapshot({0: 5})[0]] ___________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_4.py:9: in 195s assert 4 == snapshot({0: 5})[0] 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_4.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 4 == snapshot({0: 5})[0] 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____________ test_generic[executing] [assert 4 == snapshot(2+2)] ______________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_5.py:9: in 195s assert 4 == snapshot(2+2) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_5.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 4 == snapshot(2+2) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _________ test_generic[executing] [assert 4 == snapshot({0: 2+2})[0]] __________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_6.py:9: in 195s assert 4 == snapshot({0: 2+2})[0] 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_6.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 4 == snapshot({0: 2+2})[0] 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic[executing] [assert 4 <= snapshot()] _______________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 195s new_code = self._value._new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 195s return self._file._value_to_code(self._new_value) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_7.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 4 <= snapshot() 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________ test_generic[executing] [assert 4 <= snapshot({})[0]] _____________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 195s to_insert.append((key, new_value_element._new_code())) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 195s return self._file._value_to_code(self._new_value) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_8.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 4 <= snapshot({})[0] 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic[executing] [assert 4 <= snapshot(5)] _______________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_9.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 4 <= snapshot(5) 195s ------------------------------ Captured log call ------------------------------- 195s 195s __________ test_generic[executing] [assert 4 <= snapshot({0: 5})[0]] ___________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_10.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 4 <= snapshot({0: 5})[0] 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic[executing] [assert 5 <= snapshot(4)] _______________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_11.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 <= snapshot(4) 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_11.py", line 9, in 195s assert 5 <= snapshot(4) 195s ^^^^^^^^^^^^^^^^ 195s AssertionError 195s ------------------------------ Captured log call ------------------------------- 195s 195s __________ test_generic[executing] [assert 5 <= snapshot({0: 4})[0]] ___________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_12.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 <= snapshot({0: 4})[0] 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_12.py", line 9, in 195s assert 5 <= snapshot({0: 4})[0] 195s ^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____________ test_generic[executing] [assert 5 <= snapshot(3+2)] ______________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_13.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 <= snapshot(3+2) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _________ test_generic[executing] [assert 5 <= snapshot({0: 3+2})[0]] __________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_14.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 <= snapshot({0: 3+2})[0] 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic[executing] [assert 5 >= snapshot()] _______________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 195s new_code = self._value._new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 195s return self._file._value_to_code(self._new_value) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_15.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 >= snapshot() 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________ test_generic[executing] [assert 5 >= snapshot({})[0]] _____________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 195s to_insert.append((key, new_value_element._new_code())) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 195s return self._file._value_to_code(self._new_value) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_16.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 >= snapshot({})[0] 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic[executing] [assert 5 >= snapshot(4)] _______________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_17.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 >= snapshot(4) 195s ------------------------------ Captured log call ------------------------------- 195s 195s __________ test_generic[executing] [assert 5 >= snapshot({0: 4})[0]] ___________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_18.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 >= snapshot({0: 4})[0] 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic[executing] [assert 4 >= snapshot(5)] _______________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_19.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 4 >= snapshot(5) 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_19.py", line 9, in 195s assert 4 >= snapshot(5) 195s ^^^^^^^^^^^^^^^^ 195s AssertionError 195s ------------------------------ Captured log call ------------------------------- 195s 195s __________ test_generic[executing] [assert 4 >= snapshot({0: 5})[0]] ___________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_20.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 4 >= snapshot({0: 5})[0] 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_20.py", line 9, in 195s assert 4 >= snapshot({0: 5})[0] 195s ^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____________ test_generic[executing] [assert 5 >= snapshot(3+2)] ______________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_21.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 >= snapshot(3+2) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _________ test_generic[executing] [assert 5 >= snapshot({0: 3+2})[0]] __________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_22.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 >= snapshot({0: 3+2})[0] 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic[executing] [assert 5 in snapshot()] _______________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 195s new_code = self._value._new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:411: in _new_code 195s return self._file._value_to_code(self._new_value) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '[5 ]' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_23.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 in snapshot() 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________ test_generic[executing] [assert 5 in snapshot({})[0]] _____________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 195s to_insert.append((key, new_value_element._new_code())) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:411: in _new_code 195s return self._file._value_to_code(self._new_value) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '[5 ]' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_24.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 in snapshot({})[0] 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________ test_generic[executing] [assert 5 in snapshot([4, 5])] ____________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s s = source(code) 195s print("source:", code) 195s 195s if not executing_used and reported_flag == "update": 195s assert not s.flags 195s else: 195s assert list(s.flags) == [reported_flag] 195s 195s assert (reported_flag == "fix") == s.error 195s 195s for flag in all_flags: 195s if flag == reported_flag: 195s continue 195s print("use flag:", flag) 195s s2 = s.run(flag) 195s assert s2.source == s.source 195s 195s if not executing_used: 195s continue 195s 195s > s2 = s.run(reported_flag) 195s 195s tests/test_inline_snapshot.py:99: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:137: in run 195s recorder.fix_all() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 195s file.rewrite() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 195s new_code = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s 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])' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_29.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 in snapshot([4, 5]) 195s reported_flags: {'trim'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert 5 in snapshot([4, 5]) 195s source: assert 5 in snapshot([4, 5]) 195s use flag: fix 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 in snapshot([4, 5]) 195s reported_flags: {'trim'} 195s run: pytest --inline-snapshot=fix 195s output: 195s |assert 5 in snapshot([4, 5]) 195s use flag: create 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 in snapshot([4, 5]) 195s reported_flags: {'trim'} 195s run: pytest --inline-snapshot=create 195s output: 195s |assert 5 in snapshot([4, 5]) 195s use flag: update 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 in snapshot([4, 5]) 195s reported_flags: {'trim'} 195s run: pytest --inline-snapshot=update 195s output: 195s |assert 5 in snapshot([4, 5]) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 in snapshot([4, 5]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ________ test_generic[executing] [assert 5 in snapshot({0: [4, 5]})[0]] ________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s s = source(code) 195s print("source:", code) 195s 195s if not executing_used and reported_flag == "update": 195s assert not s.flags 195s else: 195s assert list(s.flags) == [reported_flag] 195s 195s assert (reported_flag == "fix") == s.error 195s 195s for flag in all_flags: 195s if flag == reported_flag: 195s continue 195s print("use flag:", flag) 195s s2 = s.run(flag) 195s assert s2.source == s.source 195s 195s if not executing_used: 195s continue 195s 195s > s2 = s.run(reported_flag) 195s 195s tests/test_inline_snapshot.py:99: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:137: in run 195s recorder.fix_all() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 195s file.rewrite() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 195s new_code = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s 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]' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_34.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 in snapshot({0: [4, 5]})[0] 195s reported_flags: {'trim'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert 5 in snapshot({0: [4, 5]})[0] 195s source: assert 5 in snapshot({0: [4, 5]})[0] 195s use flag: fix 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 in snapshot({0: [4, 5]})[0] 195s reported_flags: {'trim'} 195s run: pytest --inline-snapshot=fix 195s output: 195s |assert 5 in snapshot({0: [4, 5]})[0] 195s use flag: create 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 in snapshot({0: [4, 5]})[0] 195s reported_flags: {'trim'} 195s run: pytest --inline-snapshot=create 195s output: 195s |assert 5 in snapshot({0: [4, 5]})[0] 195s use flag: update 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 in snapshot({0: [4, 5]})[0] 195s reported_flags: {'trim'} 195s run: pytest --inline-snapshot=update 195s output: 195s |assert 5 in snapshot({0: [4, 5]})[0] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 in snapshot({0: [4, 5]})[0] 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic[executing] [assert 5 in snapshot([])] ______________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 195s new_code=[self._file._value_to_code(v) for v in new_values], 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_35.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 in snapshot([]) 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_35.py", line 9, in 195s assert 5 in snapshot([]) 195s ^^^^^^^^^^^^^^^^^ 195s AssertionError 195s ------------------------------ Captured log call ------------------------------- 195s 195s __________ test_generic[executing] [assert 5 in snapshot({0: []})[0]] __________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 195s new_code=[self._file._value_to_code(v) for v in new_values], 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_36.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 in snapshot({0: []})[0] 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_36.py", line 9, in 195s assert 5 in snapshot({0: []})[0] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________ test_generic[executing] [assert 5 in snapshot([3+2])] _____________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_37.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 in snapshot([3+2]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ________ test_generic[executing] [assert 5 in snapshot({0: [3+2]})[0]] _________ 195s 195s source = .w at 0x748e1a079440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s executing_used = True 195s 195s def test_generic(source, subtests, executing_used): 195s codes = [] 195s 195s for op in operations: 195s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 195s if op.svalue: 195s codes.append( 195s ( 195s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 195s op.flag, 195s ) 195s ) 195s else: 195s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 195s 195s all_flags = ["trim", "fix", "create", "update"] 195s 195s for code, reported_flag in codes: 195s with subtests.test(code): 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:79: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_38.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 in snapshot({0: [3+2]})[0] 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic_multi[executing-create(==) fix(==)] _______________ 195s 195s source = .w at 0x748e1a226b60> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='==', svalue='5', fvalue='4', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c0/test_1.py:10: in 195s print(4 == s["k_0"]) # create -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": 5}) 195s |print(4 == s["k_0"]) # create -> 4 195s |print(4 == s["k_1"]) # fix 5 -> 4 195s _____________ test_generic_multi[executing-create(==) update(==)] ______________ 195s 195s source = .w at 0x748e1a2272e0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c1/test_1.py:10: in 195s print(4 == s["k_0"]) # create -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c1/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": 2+2}) 195s |print(4 == s["k_0"]) # create -> 4 195s |print(4 == s["k_1"]) # update 2+2 -> 4 195s _____________ test_generic_multi[executing-create(==) create(<=)] ______________ 195s 195s source = .w at 0x748e1a226ac0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='<=', svalue='', fvalue='4', flag='create')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c2/test_1.py:10: in 195s print(4 == s["k_0"]) # create -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c2/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({}) 195s |print(4 == s["k_0"]) # create -> 4 195s |print(4 <= s["k_1"]) # create -> 4 195s ______________ test_generic_multi[executing-create(==) trim(<=)] _______________ 195s 195s source = .w at 0x748e1a227ec0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c3/test_1.py:10: in 195s print(4 == s["k_0"]) # create -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c3/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": 5}) 195s |print(4 == s["k_0"]) # create -> 4 195s |print(4 <= s["k_1"]) # trim 5 -> 4 195s _______________ test_generic_multi[executing-create(==) fix(<=)] _______________ 195s 195s source = .w at 0x748e19bf0900> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c4/test_1.py:10: in 195s print(4 == s["k_0"]) # create -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c4/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": 4}) 195s |print(4 == s["k_0"]) # create -> 4 195s |print(5 <= s["k_1"]) # fix 4 -> 5 195s _____________ test_generic_multi[executing-create(==) update(<=)] ______________ 195s 195s source = .w at 0x748e1a226c00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c5/test_1.py:10: in 195s print(4 == s["k_0"]) # create -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c5/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": 3+2}) 195s |print(4 == s["k_0"]) # create -> 4 195s |print(5 <= s["k_1"]) # update 3+2 -> 5 195s _____________ test_generic_multi[executing-create(==) create(>=)] ______________ 195s 195s source = .w at 0x748e19bf05e0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c6/test_1.py:10: in 195s print(4 == s["k_0"]) # create -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c6/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({}) 195s |print(4 == s["k_0"]) # create -> 4 195s |print(5 >= s["k_1"]) # create -> 5 195s ______________ test_generic_multi[executing-create(==) trim(>=)] _______________ 195s 195s source = .w at 0x748e19bf19e0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c7/test_1.py:10: in 195s print(4 == s["k_0"]) # create -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c7/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": 4}) 195s |print(4 == s["k_0"]) # create -> 4 195s |print(5 >= s["k_1"]) # trim 4 -> 5 195s _______________ test_generic_multi[executing-create(==) fix(>=)] _______________ 195s 195s source = .w at 0x748e1a226b60> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c8/test_1.py:10: in 195s print(4 == s["k_0"]) # create -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c8/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": 5}) 195s |print(4 == s["k_0"]) # create -> 4 195s |print(4 >= s["k_1"]) # fix 5 -> 4 195s _____________ test_generic_multi[executing-create(==) update(>=)] ______________ 195s 195s source = .w at 0x748e19bf16c0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c9/test_1.py:10: in 195s print(4 == s["k_0"]) # create -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c9/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": 3+2}) 195s |print(4 == s["k_0"]) # create -> 4 195s |print(5 >= s["k_1"]) # update 3+2 -> 5 195s _____________ test_generic_multi[executing-create(==) create(in)] ______________ 195s 195s source = .w at 0x748e19bf2a20> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c10/test_1.py:10: in 195s print(4 == s["k_0"]) # create -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c10/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({}) 195s |print(4 == s["k_0"]) # create -> 4 195s |print(5 in s["k_1"]) # create -> [5] 195s ______________ test_generic_multi[executing-create(==) trim(in)] _______________ 195s 195s source = .w at 0x748e1a07b2e0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c11/test_1.py:10: in 195s print(4 == s["k_0"]) # create -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c11/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": [4, 5]}) 195s |print(4 == s["k_0"]) # create -> 4 195s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 195s _______________ test_generic_multi[executing-create(==) fix(in)] _______________ 195s 195s source = .w at 0x748e1a225120> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c12/test_1.py:10: in 195s print(4 == s["k_0"]) # create -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c12/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": []}) 195s |print(4 == s["k_0"]) # create -> 4 195s |print(5 in s["k_1"]) # fix [] -> [5] 195s _____________ test_generic_multi[executing-create(==) update(in)] ______________ 195s 195s source = .w at 0x748e1a225620> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c13/test_1.py:10: in 195s print(4 == s["k_0"]) # create -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c13/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": [3+2]}) 195s |print(4 == s["k_0"]) # create -> 4 195s |print(5 in s["k_1"]) # update [3+2] -> [5] 195s _______________ test_generic_multi[executing-fix(==) update(==)] _______________ 195s 195s source = .w at 0x748e1a07ba60> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f0/test_1.py:10: in 195s print(4 == s["k_0"]) # fix 5 -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5, "k_1": 2+2}) 195s |print(4 == s["k_0"]) # fix 5 -> 4 195s |print(4 == s["k_1"]) # update 2+2 -> 4 195s _______________ test_generic_multi[executing-fix(==) create(<=)] _______________ 195s 195s source = .w at 0x748e1a2274c0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='4', op='<=', svalue='', fvalue='4', flag='create')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f1/test_1.py:10: in 195s print(4 == s["k_0"]) # fix 5 -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f1/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5}) 195s |print(4 == s["k_0"]) # fix 5 -> 4 195s |print(4 <= s["k_1"]) # create -> 4 195s ________________ test_generic_multi[executing-fix(==) trim(<=)] ________________ 195s 195s source = .w at 0x748e19bf0720> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f2/test_1.py:10: in 195s print(4 == s["k_0"]) # fix 5 -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f2/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5, "k_1": 5}) 195s |print(4 == s["k_0"]) # fix 5 -> 4 195s |print(4 <= s["k_1"]) # trim 5 -> 4 195s ________________ test_generic_multi[executing-fix(==) fix(<=)] _________________ 195s 195s source = .w at 0x748e1a2271a0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f3/test_1.py:10: in 195s print(4 == s["k_0"]) # fix 5 -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f3/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5, "k_1": 4}) 195s |print(4 == s["k_0"]) # fix 5 -> 4 195s |print(5 <= s["k_1"]) # fix 4 -> 5 195s _______________ test_generic_multi[executing-fix(==) update(<=)] _______________ 195s 195s source = .w at 0x748e19bf0b80> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f4/test_1.py:10: in 195s print(4 == s["k_0"]) # fix 5 -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f4/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5, "k_1": 3+2}) 195s |print(4 == s["k_0"]) # fix 5 -> 4 195s |print(5 <= s["k_1"]) # update 3+2 -> 5 195s _______________ test_generic_multi[executing-fix(==) create(>=)] _______________ 195s 195s source = .w at 0x748e19bf3600> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f5/test_1.py:10: in 195s print(4 == s["k_0"]) # fix 5 -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f5/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5}) 195s |print(4 == s["k_0"]) # fix 5 -> 4 195s |print(5 >= s["k_1"]) # create -> 5 195s ________________ test_generic_multi[executing-fix(==) trim(>=)] ________________ 195s 195s source = .w at 0x748e1a227600> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f6/test_1.py:10: in 195s print(4 == s["k_0"]) # fix 5 -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f6/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5, "k_1": 4}) 195s |print(4 == s["k_0"]) # fix 5 -> 4 195s |print(5 >= s["k_1"]) # trim 4 -> 5 195s ________________ test_generic_multi[executing-fix(==) fix(>=)] _________________ 195s 195s source = .w at 0x748e19bf16c0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f7/test_1.py:10: in 195s print(4 == s["k_0"]) # fix 5 -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f7/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5, "k_1": 5}) 195s |print(4 == s["k_0"]) # fix 5 -> 4 195s |print(4 >= s["k_1"]) # fix 5 -> 4 195s _______________ test_generic_multi[executing-fix(==) update(>=)] _______________ 195s 195s source = .w at 0x748e19ce8680> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f8/test_1.py:10: in 195s print(4 == s["k_0"]) # fix 5 -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f8/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5, "k_1": 3+2}) 195s |print(4 == s["k_0"]) # fix 5 -> 4 195s |print(5 >= s["k_1"]) # update 3+2 -> 5 195s _______________ test_generic_multi[executing-fix(==) create(in)] _______________ 195s 195s source = .w at 0x748e1a227420> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f9/test_1.py:10: in 195s print(4 == s["k_0"]) # fix 5 -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f9/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5}) 195s |print(4 == s["k_0"]) # fix 5 -> 4 195s |print(5 in s["k_1"]) # create -> [5] 195s ________________ test_generic_multi[executing-fix(==) trim(in)] ________________ 195s 195s source = .w at 0x748e19ce8360> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f10/test_1.py:10: in 195s print(4 == s["k_0"]) # fix 5 -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f10/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5, "k_1": [4, 5]}) 195s |print(4 == s["k_0"]) # fix 5 -> 4 195s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 195s ________________ test_generic_multi[executing-fix(==) fix(in)] _________________ 195s 195s source = .w at 0x748e19ce9760> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f11/test_1.py:10: in 195s print(4 == s["k_0"]) # fix 5 -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f11/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5, "k_1": []}) 195s |print(4 == s["k_0"]) # fix 5 -> 4 195s |print(5 in s["k_1"]) # fix [] -> [5] 195s _______________ test_generic_multi[executing-fix(==) update(in)] _______________ 195s 195s source = .w at 0x748e1a227420> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f12/test_1.py:10: in 195s print(4 == s["k_0"]) # fix 5 -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f12/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5, "k_1": [3+2]}) 195s |print(4 == s["k_0"]) # fix 5 -> 4 195s |print(5 in s["k_1"]) # update [3+2] -> [5] 195s _____________ test_generic_multi[executing-update(==) create(<=)] ______________ 195s 195s source = .w at 0x748e19ce8360> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='4', op='<=', svalue='', fvalue='4', flag='create')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u0/test_1.py:10: in 195s print(4 == s["k_0"]) # update 2+2 -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 2+2}) 195s |print(4 == s["k_0"]) # update 2+2 -> 4 195s |print(4 <= s["k_1"]) # create -> 4 195s ______________ test_generic_multi[executing-update(==) trim(<=)] _______________ 195s 195s source = .w at 0x748e19cea840> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u1/test_1.py:10: in 195s print(4 == s["k_0"]) # update 2+2 -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u1/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 2+2, "k_1": 5}) 195s |print(4 == s["k_0"]) # update 2+2 -> 4 195s |print(4 <= s["k_1"]) # trim 5 -> 4 195s _______________ test_generic_multi[executing-update(==) fix(<=)] _______________ 195s 195s source = .w at 0x748e19bf3c40> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u2/test_1.py:10: in 195s print(4 == s["k_0"]) # update 2+2 -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u2/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 2+2, "k_1": 4}) 195s |print(4 == s["k_0"]) # update 2+2 -> 4 195s |print(5 <= s["k_1"]) # fix 4 -> 5 195s _____________ test_generic_multi[executing-update(==) update(<=)] ______________ 195s 195s source = .w at 0x748e19cea200> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u3/test_1.py:10: in 195s print(4 == s["k_0"]) # update 2+2 -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u3/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 2+2, "k_1": 3+2}) 195s |print(4 == s["k_0"]) # update 2+2 -> 4 195s |print(5 <= s["k_1"]) # update 3+2 -> 5 195s _____________ test_generic_multi[executing-update(==) create(>=)] ______________ 195s 195s source = .w at 0x748e19ceb920> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u4/test_1.py:10: in 195s print(4 == s["k_0"]) # update 2+2 -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u4/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 2+2}) 195s |print(4 == s["k_0"]) # update 2+2 -> 4 195s |print(5 >= s["k_1"]) # create -> 5 195s ______________ test_generic_multi[executing-update(==) trim(>=)] _______________ 195s 195s source = .w at 0x748e19bf1d00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u5/test_1.py:10: in 195s print(4 == s["k_0"]) # update 2+2 -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u5/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 2+2, "k_1": 4}) 195s |print(4 == s["k_0"]) # update 2+2 -> 4 195s |print(5 >= s["k_1"]) # trim 4 -> 5 195s _______________ test_generic_multi[executing-update(==) fix(>=)] _______________ 195s 195s source = .w at 0x748e19ceb1a0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u6/test_1.py:10: in 195s print(4 == s["k_0"]) # update 2+2 -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u6/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 2+2, "k_1": 5}) 195s |print(4 == s["k_0"]) # update 2+2 -> 4 195s |print(4 >= s["k_1"]) # fix 5 -> 4 195s _____________ test_generic_multi[executing-update(==) update(>=)] ______________ 195s 195s source = .w at 0x748e19af8a40> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u7/test_1.py:10: in 195s print(4 == s["k_0"]) # update 2+2 -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u7/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 2+2, "k_1": 3+2}) 195s |print(4 == s["k_0"]) # update 2+2 -> 4 195s |print(5 >= s["k_1"]) # update 3+2 -> 5 195s _____________ test_generic_multi[executing-update(==) create(in)] ______________ 195s 195s source = .w at 0x748e19ce8fe0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u8/test_1.py:10: in 195s print(4 == s["k_0"]) # update 2+2 -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u8/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 2+2}) 195s |print(4 == s["k_0"]) # update 2+2 -> 4 195s |print(5 in s["k_1"]) # create -> [5] 195s ______________ test_generic_multi[executing-update(==) trim(in)] _______________ 195s 195s source = .w at 0x748e19af8720> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u9/test_1.py:10: in 195s print(4 == s["k_0"]) # update 2+2 -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u9/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 2+2, "k_1": [4, 5]}) 195s |print(4 == s["k_0"]) # update 2+2 -> 4 195s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 195s _______________ test_generic_multi[executing-update(==) fix(in)] _______________ 195s 195s source = .w at 0x748e19af99e0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u10/test_1.py:10: in 195s print(4 == s["k_0"]) # update 2+2 -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u10/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 2+2, "k_1": []}) 195s |print(4 == s["k_0"]) # update 2+2 -> 4 195s |print(5 in s["k_1"]) # fix [] -> [5] 195s _____________ test_generic_multi[executing-update(==) update(in)] ______________ 195s 195s source = .w at 0x748e19ce8f40> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u11/test_1.py:10: in 195s print(4 == s["k_0"]) # update 2+2 -> 4 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u11/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 2+2, "k_1": [3+2]}) 195s |print(4 == s["k_0"]) # update 2+2 -> 4 195s |print(5 in s["k_1"]) # update [3+2] -> [5] 195s ______________ test_generic_multi[executing-create(<=) trim(<=)] _______________ 195s 195s source = .w at 0x748e19af9260> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c14/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": 5}) 195s |print(4 <= s["k_0"]) # create -> 4 195s |print(4 <= s["k_1"]) # trim 5 -> 4 195s True 195s True 195s _______________ test_generic_multi[executing-create(<=) fix(<=)] _______________ 195s 195s source = .w at 0x748e19afa660> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c15/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": 4}) 195s |print(4 <= s["k_0"]) # create -> 4 195s |print(5 <= s["k_1"]) # fix 4 -> 5 195s True 195s False 195s _____________ test_generic_multi[executing-create(<=) update(<=)] ______________ 195s 195s source = .w at 0x748e19ce9f80> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c16/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": 3+2}) 195s |print(4 <= s["k_0"]) # create -> 4 195s |print(5 <= s["k_1"]) # update 3+2 -> 5 195s True 195s True 195s _____________ test_generic_multi[executing-create(<=) create(>=)] ______________ 195s 195s source = .w at 0x748e19af9440> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 195s to_insert.append((key, new_value_element._new_code())) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 195s return self._file._value_to_code(self._new_value) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c17/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({}) 195s |print(4 <= s["k_0"]) # create -> 4 195s |print(5 >= s["k_1"]) # create -> 5 195s True 195s True 195s ______________ test_generic_multi[executing-create(<=) trim(>=)] _______________ 195s 195s source = .w at 0x748e19afb600> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c18/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": 4}) 195s |print(4 <= s["k_0"]) # create -> 4 195s |print(5 >= s["k_1"]) # trim 4 -> 5 195s True 195s True 195s _______________ test_generic_multi[executing-create(<=) fix(>=)] _______________ 195s 195s source = .w at 0x748e19ce8f40> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c19/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": 5}) 195s |print(4 <= s["k_0"]) # create -> 4 195s |print(4 >= s["k_1"]) # fix 5 -> 4 195s True 195s False 195s _____________ test_generic_multi[executing-create(<=) update(>=)] ______________ 195s 195s source = .w at 0x748e19cebba0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c20/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": 3+2}) 195s |print(4 <= s["k_0"]) # create -> 4 195s |print(5 >= s["k_1"]) # update 3+2 -> 5 195s True 195s True 195s _____________ test_generic_multi[executing-create(<=) create(in)] ______________ 195s 195s source = .w at 0x748e19cea7a0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 195s to_insert.append((key, new_value_element._new_code())) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 195s return self._file._value_to_code(self._new_value) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c21/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({}) 195s |print(4 <= s["k_0"]) # create -> 4 195s |print(5 in s["k_1"]) # create -> [5] 195s True 195s True 195s ______________ test_generic_multi[executing-create(<=) trim(in)] _______________ 195s 195s source = .w at 0x748e19ce9a80> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 195s to_insert.append((key, new_value_element._new_code())) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 195s return self._file._value_to_code(self._new_value) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c22/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": [4, 5]}) 195s |print(4 <= s["k_0"]) # create -> 4 195s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 195s True 195s True 195s _______________ test_generic_multi[executing-create(<=) fix(in)] _______________ 195s 195s source = .w at 0x748e19ce8c20> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 195s new_code=[self._file._value_to_code(v) for v in new_values], 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c23/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": []}) 195s |print(4 <= s["k_0"]) # create -> 4 195s |print(5 in s["k_1"]) # fix [] -> [5] 195s True 195s False 195s _____________ test_generic_multi[executing-create(<=) update(in)] ______________ 195s 195s source = .w at 0x748e19cebce0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c24/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": [3+2]}) 195s |print(4 <= s["k_0"]) # create -> 4 195s |print(5 in s["k_1"]) # update [3+2] -> [5] 195s True 195s True 195s ________________ test_generic_multi[executing-trim(<=) fix(<=)] ________________ 195s 195s source = .w at 0x748e19bf3880> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5, "k_1": 4}) 195s |print(4 <= s["k_0"]) # trim 5 -> 4 195s |print(5 <= s["k_1"]) # fix 4 -> 5 195s True 195s False 195s ______________ test_generic_multi[executing-trim(<=) update(<=)] _______________ 195s 195s source = .w at 0x748e1a226340> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t1/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5, "k_1": 3+2}) 195s |print(4 <= s["k_0"]) # trim 5 -> 4 195s |print(5 <= s["k_1"]) # update 3+2 -> 5 195s True 195s True 195s ______________ test_generic_multi[executing-trim(<=) create(>=)] _______________ 195s 195s source = .w at 0x748e19ce98a0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t2/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5}) 195s |print(4 <= s["k_0"]) # trim 5 -> 4 195s |print(5 >= s["k_1"]) # create -> 5 195s True 195s True 195s _______________ test_generic_multi[executing-trim(<=) trim(>=)] ________________ 195s 195s source = .w at 0x748e19bf2ca0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t3/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5, "k_1": 4}) 195s |print(4 <= s["k_0"]) # trim 5 -> 4 195s |print(5 >= s["k_1"]) # trim 4 -> 5 195s True 195s True 195s ________________ test_generic_multi[executing-trim(<=) fix(>=)] ________________ 195s 195s source = .w at 0x748e19bf0180> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t4/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5, "k_1": 5}) 195s |print(4 <= s["k_0"]) # trim 5 -> 4 195s |print(4 >= s["k_1"]) # fix 5 -> 4 195s True 195s False 195s ______________ test_generic_multi[executing-trim(<=) update(>=)] _______________ 195s 195s source = .w at 0x748e19cebce0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t5/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5, "k_1": 3+2}) 195s |print(4 <= s["k_0"]) # trim 5 -> 4 195s |print(5 >= s["k_1"]) # update 3+2 -> 5 195s True 195s True 195s ______________ test_generic_multi[executing-trim(<=) create(in)] _______________ 195s 195s source = .w at 0x748e19afade0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t6/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5}) 195s |print(4 <= s["k_0"]) # trim 5 -> 4 195s |print(5 in s["k_1"]) # create -> [5] 195s True 195s True 195s _______________ test_generic_multi[executing-trim(<=) trim(in)] ________________ 195s 195s source = .w at 0x748e19bf3100> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t7/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5, "k_1": [4, 5]}) 195s |print(4 <= s["k_0"]) # trim 5 -> 4 195s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 195s True 195s True 195s ________________ test_generic_multi[executing-trim(<=) fix(in)] ________________ 195s 195s source = .w at 0x748e19afb600> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t8/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5, "k_1": []}) 195s |print(4 <= s["k_0"]) # trim 5 -> 4 195s |print(5 in s["k_1"]) # fix [] -> [5] 195s True 195s False 195s ______________ test_generic_multi[executing-trim(<=) update(in)] _______________ 195s 195s source = .w at 0x748e19af8860> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t9/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5, "k_1": [3+2]}) 195s |print(4 <= s["k_0"]) # trim 5 -> 4 195s |print(5 in s["k_1"]) # update [3+2] -> [5] 195s True 195s True 195s _______________ test_generic_multi[executing-fix(<=) update(<=)] _______________ 195s 195s source = .w at 0x748e19afbce0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f13/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 4, "k_1": 3+2}) 195s |print(5 <= s["k_0"]) # fix 4 -> 5 195s |print(5 <= s["k_1"]) # update 3+2 -> 5 195s False 195s True 195s _______________ test_generic_multi[executing-fix(<=) create(>=)] _______________ 195s 195s source = .w at 0x748e19ce9580> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f14/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 4}) 195s |print(5 <= s["k_0"]) # fix 4 -> 5 195s |print(5 >= s["k_1"]) # create -> 5 195s False 195s True 195s ________________ test_generic_multi[executing-fix(<=) trim(>=)] ________________ 195s 195s source = .w at 0x748e19854900> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f15/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 4, "k_1": 4}) 195s |print(5 <= s["k_0"]) # fix 4 -> 5 195s |print(5 >= s["k_1"]) # trim 4 -> 5 195s False 195s True 195s ________________ test_generic_multi[executing-fix(<=) fix(>=)] _________________ 195s 195s source = .w at 0x748e1a62a5c0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f16/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 4, "k_1": 5}) 195s |print(5 <= s["k_0"]) # fix 4 -> 5 195s |print(4 >= s["k_1"]) # fix 5 -> 4 195s False 195s False 195s _______________ test_generic_multi[executing-fix(<=) update(>=)] _______________ 195s 195s source = .w at 0x748e198553a0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f17/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 4, "k_1": 3+2}) 195s |print(5 <= s["k_0"]) # fix 4 -> 5 195s |print(5 >= s["k_1"]) # update 3+2 -> 5 195s False 195s True 195s _______________ test_generic_multi[executing-fix(<=) create(in)] _______________ 195s 195s source = .w at 0x748e198559e0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f18/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 4}) 195s |print(5 <= s["k_0"]) # fix 4 -> 5 195s |print(5 in s["k_1"]) # create -> [5] 195s False 195s True 195s ________________ test_generic_multi[executing-fix(<=) trim(in)] ________________ 195s 195s source = .w at 0x748e19af8b80> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f19/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 4, "k_1": [4, 5]}) 195s |print(5 <= s["k_0"]) # fix 4 -> 5 195s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 195s False 195s True 195s ________________ test_generic_multi[executing-fix(<=) fix(in)] _________________ 195s 195s source = .w at 0x748e19855580> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f20/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 4, "k_1": []}) 195s |print(5 <= s["k_0"]) # fix 4 -> 5 195s |print(5 in s["k_1"]) # fix [] -> [5] 195s False 195s False 195s _______________ test_generic_multi[executing-fix(<=) update(in)] _______________ 195s 195s source = .w at 0x748e19856b60> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f21/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 4, "k_1": [3+2]}) 195s |print(5 <= s["k_0"]) # fix 4 -> 5 195s |print(5 in s["k_1"]) # update [3+2] -> [5] 195s False 195s True 195s _____________ test_generic_multi[executing-update(<=) create(>=)] ______________ 195s 195s source = .w at 0x748e19afbec0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u12/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 3+2}) 195s |print(5 <= s["k_0"]) # update 3+2 -> 5 195s |print(5 >= s["k_1"]) # create -> 5 195s True 195s True 195s ______________ test_generic_multi[executing-update(<=) trim(>=)] _______________ 195s 195s source = .w at 0x748e19854360> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u13/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 3+2, "k_1": 4}) 195s |print(5 <= s["k_0"]) # update 3+2 -> 5 195s |print(5 >= s["k_1"]) # trim 4 -> 5 195s True 195s True 195s _______________ test_generic_multi[executing-update(<=) fix(>=)] _______________ 195s 195s source = .w at 0x748e19857c40> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u14/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 3+2, "k_1": 5}) 195s |print(5 <= s["k_0"]) # update 3+2 -> 5 195s |print(4 >= s["k_1"]) # fix 5 -> 4 195s True 195s False 195s _____________ test_generic_multi[executing-update(<=) update(>=)] ______________ 195s 195s source = .w at 0x748e19856660> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==)]>>) 195s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u15/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 3+2, "k_1": 3+2}) 195s |print(5 <= s["k_0"]) # update 3+2 -> 5 195s |print(5 >= s["k_1"]) # update 3+2 -> 5 195s True 195s True 195s _____________ test_generic_multi[executing-update(<=) create(in)] ______________ 195s 195s source = .w at 0x748e19857600> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u16/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 3+2}) 195s |print(5 <= s["k_0"]) # update 3+2 -> 5 195s |print(5 in s["k_1"]) # create -> [5] 195s True 195s True 195s ______________ test_generic_multi[executing-update(<=) trim(in)] _______________ 195s 195s source = .w at 0x748e19834d60> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u17/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 3+2, "k_1": [4, 5]}) 195s |print(5 <= s["k_0"]) # update 3+2 -> 5 195s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 195s True 195s True 195s _______________ test_generic_multi[executing-update(<=) fix(in)] _______________ 195s 195s source = .w at 0x748e198554e0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u18/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 3+2, "k_1": []}) 195s |print(5 <= s["k_0"]) # update 3+2 -> 5 195s |print(5 in s["k_1"]) # fix [] -> [5] 195s True 195s False 195s _____________ test_generic_multi[executing-update(<=) update(in)] ______________ 195s 195s source = .w at 0x748e198349a0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u19/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 3+2, "k_1": [3+2]}) 195s |print(5 <= s["k_0"]) # update 3+2 -> 5 195s |print(5 in s["k_1"]) # update [3+2] -> [5] 195s True 195s True 195s ______________ test_generic_multi[executing-create(>=) trim(>=)] _______________ 195s 195s source = .w at 0x748e19835d00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==) trim(>=)]>>) 195s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c25/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": 4}) 195s |print(5 >= s["k_0"]) # create -> 5 195s |print(5 >= s["k_1"]) # trim 4 -> 5 195s True 195s True 195s _______________ test_generic_multi[executing-create(>=) fix(>=)] _______________ 195s 195s source = .w at 0x748e19bf2b60> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==) fix(>=)]>>) 195s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c26/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": 5}) 195s |print(5 >= s["k_0"]) # create -> 5 195s |print(4 >= s["k_1"]) # fix 5 -> 4 195s True 195s False 195s _____________ test_generic_multi[executing-create(>=) update(>=)] ______________ 195s 195s source = .w at 0x748e19bf3920> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==) update(>=)]>>) 195s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c27/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": 3+2}) 195s |print(5 >= s["k_0"]) # create -> 5 195s |print(5 >= s["k_1"]) # update 3+2 -> 5 195s True 195s True 195s _____________ test_generic_multi[executing-create(>=) create(in)] ______________ 195s 195s source = .w at 0x748e19cea340> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==) create(in)]>>) 195s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 195s to_insert.append((key, new_value_element._new_code())) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 195s return self._file._value_to_code(self._new_value) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c28/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({}) 195s |print(5 >= s["k_0"]) # create -> 5 195s |print(5 in s["k_1"]) # create -> [5] 195s True 195s True 195s ______________ test_generic_multi[executing-create(>=) trim(in)] _______________ 195s 195s source = .w at 0x748e19ce8ae0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==) trim(in)]>>) 195s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 195s to_insert.append((key, new_value_element._new_code())) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 195s return self._file._value_to_code(self._new_value) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c29/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": [4, 5]}) 195s |print(5 >= s["k_0"]) # create -> 5 195s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 195s True 195s True 195s _______________ test_generic_multi[executing-create(>=) fix(in)] _______________ 195s 195s source = .w at 0x748e19bf3880> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==) fix(in)]>>) 195s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 195s new_code=[self._file._value_to_code(v) for v in new_values], 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c30/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": []}) 195s |print(5 >= s["k_0"]) # create -> 5 195s |print(5 in s["k_1"]) # fix [] -> [5] 195s True 195s False 195s _____________ test_generic_multi[executing-create(>=) update(in)] ______________ 195s 195s source = .w at 0x748e19afa0c0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==) update(in)]>>) 195s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c31/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": [3+2]}) 195s |print(5 >= s["k_0"]) # create -> 5 195s |print(5 in s["k_1"]) # update [3+2] -> [5] 195s True 195s True 195s ________________ test_generic_multi[executing-trim(>=) fix(>=)] ________________ 195s 195s source = .w at 0x748e19af9a80> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==) fix(>=)]>>) 195s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t10/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 4, "k_1": 5}) 195s |print(5 >= s["k_0"]) # trim 4 -> 5 195s |print(4 >= s["k_1"]) # fix 5 -> 4 195s True 195s False 195s ______________ test_generic_multi[executing-trim(>=) update(>=)] _______________ 195s 195s source = .w at 0x748e19bf3740> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==) update(>=)]>>) 195s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t11/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 4, "k_1": 3+2}) 195s |print(5 >= s["k_0"]) # trim 4 -> 5 195s |print(5 >= s["k_1"]) # update 3+2 -> 5 195s True 195s True 195s ______________ test_generic_multi[executing-trim(>=) create(in)] _______________ 195s 195s source = .w at 0x748e19857560> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==) create(in)]>>) 195s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t12/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 4}) 195s |print(5 >= s["k_0"]) # trim 4 -> 5 195s |print(5 in s["k_1"]) # create -> [5] 195s True 195s True 195s _______________ test_generic_multi[executing-trim(>=) trim(in)] ________________ 195s 195s source = .w at 0x748e1a1d79c0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==) trim(in)]>>) 195s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t13/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 4, "k_1": [4, 5]}) 195s |print(5 >= s["k_0"]) # trim 4 -> 5 195s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 195s True 195s True 195s ________________ test_generic_multi[executing-trim(>=) fix(in)] ________________ 195s 195s source = .w at 0x748e19854fe0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==) fix(in)]>>) 195s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t14/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 4, "k_1": []}) 195s |print(5 >= s["k_0"]) # trim 4 -> 5 195s |print(5 in s["k_1"]) # fix [] -> [5] 195s True 195s False 195s ______________ test_generic_multi[executing-trim(>=) update(in)] _______________ 195s 195s source = .w at 0x748e19854220> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==) update(in)]>>) 195s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t15/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 4, "k_1": [3+2]}) 195s |print(5 >= s["k_0"]) # trim 4 -> 5 195s |print(5 in s["k_1"]) # update [3+2] -> [5] 195s True 195s True 195s _______________ test_generic_multi[executing-fix(>=) update(>=)] _______________ 195s 195s source = .w at 0x748e19854e00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==) update(>=)]>>) 195s ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f22/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5, "k_1": 3+2}) 195s |print(4 >= s["k_0"]) # fix 5 -> 4 195s |print(5 >= s["k_1"]) # update 3+2 -> 5 195s False 195s True 195s _______________ test_generic_multi[executing-fix(>=) create(in)] _______________ 195s 195s source = .w at 0x748e19af9c60> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==) create(in)]>>) 195s ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f23/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5}) 195s |print(4 >= s["k_0"]) # fix 5 -> 4 195s |print(5 in s["k_1"]) # create -> [5] 195s False 195s True 195s ________________ test_generic_multi[executing-fix(>=) trim(in)] ________________ 195s 195s source = .w at 0x748e19834040> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==) trim(in)]>>) 195s ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f24/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5, "k_1": [4, 5]}) 195s |print(4 >= s["k_0"]) # fix 5 -> 4 195s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 195s False 195s True 195s ________________ test_generic_multi[executing-fix(>=) fix(in)] _________________ 195s 195s source = .w at 0x748e19afafc0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==) fix(in)]>>) 195s ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f25/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5, "k_1": []}) 195s |print(4 >= s["k_0"]) # fix 5 -> 4 195s |print(5 in s["k_1"]) # fix [] -> [5] 195s False 195s False 195s _______________ test_generic_multi[executing-fix(>=) update(in)] _______________ 195s 195s source = .w at 0x748e19836840> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==) update(in)]>>) 195s ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f26/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 5, "k_1": [3+2]}) 195s |print(4 >= s["k_0"]) # fix 5 -> 4 195s |print(5 in s["k_1"]) # update [3+2] -> [5] 195s False 195s True 195s _____________ test_generic_multi[executing-update(>=) create(in)] ______________ 195s 195s source = .w at 0x748e19836ca0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==) create(in)]>>) 195s ops = (operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u20/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 3+2}) 195s |print(5 >= s["k_0"]) # update 3+2 -> 5 195s |print(5 in s["k_1"]) # create -> [5] 195s True 195s True 195s ______________ test_generic_multi[executing-update(>=) trim(in)] _______________ 195s 195s source = .w at 0x748e19afafc0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==) trim(in)]>>) 195s ops = (operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u21/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 3+2, "k_1": [4, 5]}) 195s |print(5 >= s["k_0"]) # update 3+2 -> 5 195s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 195s True 195s True 195s _______________ test_generic_multi[executing-update(>=) fix(in)] _______________ 195s 195s source = .w at 0x748e19834ae0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==) fix(in)]>>) 195s ops = (operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u22/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 3+2, "k_1": []}) 195s |print(5 >= s["k_0"]) # update 3+2 -> 5 195s |print(5 in s["k_1"]) # fix [] -> [5] 195s True 195s False 195s _____________ test_generic_multi[executing-update(>=) update(in)] ______________ 195s 195s source = .w at 0x748e19837ce0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request==) update(in)]>>) 195s ops = (operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u23/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": 3+2, "k_1": [3+2]}) 195s |print(5 >= s["k_0"]) # update 3+2 -> 5 195s |print(5 in s["k_1"]) # update [3+2] -> [5] 195s True 195s True 195s ______________ test_generic_multi[executing-create(in) trim(in)] _______________ 195s 195s source = .w at 0x748e19834ae0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='5', op='in', svalue='', fvalue='[5]', flag='create'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 195s to_insert.append((key, new_value_element._new_code())) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:411: in _new_code 195s return self._file._value_to_code(self._new_value) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '[5 ]' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c32/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": [4, 5]}) 195s |print(5 in s["k_0"]) # create -> [5] 195s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 195s True 195s True 195s _______________ test_generic_multi[executing-create(in) fix(in)] _______________ 195s 195s source = .w at 0x748e19854e00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='5', op='in', svalue='', fvalue='[5]', flag='create'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 195s new_code=[self._file._value_to_code(v) for v in new_values], 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c33/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": []}) 195s |print(5 in s["k_0"]) # create -> [5] 195s |print(5 in s["k_1"]) # fix [] -> [5] 195s True 195s False 195s _____________ test_generic_multi[executing-create(in) update(in)] ______________ 195s 195s source = .w at 0x748e19d0ccc0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='5', op='in', svalue='', fvalue='[5]', flag='create'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c34/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_1": [3+2]}) 195s |print(5 in s["k_0"]) # create -> [5] 195s |print(5 in s["k_1"]) # update [3+2] -> [5] 195s True 195s True 195s ________________ test_generic_multi[executing-trim(in) fix(in)] ________________ 195s 195s source = .w at 0x748e198367a0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 195s new_code=[self._file._value_to_code(v) for v in new_values], 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t16/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": [4, 5], "k_1": []}) 195s |print(5 in s["k_0"]) # trim [4, 5] -> [5] 195s |print(5 in s["k_1"]) # fix [] -> [5] 195s True 195s False 195s ______________ test_generic_multi[executing-trim(in) update(in)] _______________ 195s 195s source = .w at 0x748e19d0d9e0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s 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')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t17/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": [4, 5], "k_1": [3+2]}) 195s |print(5 in s["k_0"]) # trim [4, 5] -> [5] 195s |print(5 in s["k_1"]) # update [3+2] -> [5] 195s True 195s True 195s _______________ test_generic_multi[executing-fix(in) update(in)] _______________ 195s 195s source = .w at 0x748e19d0dda0> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx=>, request=>) 195s ops = (operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 195s executing_used = True 195s 195s @pytest.mark.parametrize( 195s "ops", 195s [ 195s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 195s for ops in itertools.combinations(operations, 2) 195s ], 195s ) 195s def test_generic_multi(source, subtests, ops, executing_used): 195s 195s def gen_code(ops, fixed, old_keys): 195s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 195s new_keys = [] 195s 195s args = [] 195s print(keys) 195s for k in keys: 195s op = ops[k] 195s value = op.fvalue if op.flag in fixed else op.svalue 195s if value: 195s args.append(f'"k_{k}": {value}') 195s new_keys.append(k) 195s args = ", ".join(args) 195s 195s code = "s = snapshot({" + args + "})\n" 195s 195s for k, op in enumerate(ops): 195s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 195s 195s return code, new_keys 195s 195s all_flags = {op.flag for op in ops} 195s 195s keys = [] 195s code, keys = gen_code(ops, {}, keys) 195s > s = source(code) 195s 195s tests/test_inline_snapshot.py:141: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 195s yield from self._new_value[key]._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 195s new_code=[self._file._value_to_code(v) for v in new_values], 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f27/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s [0, 1] 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot({"k_0": [], "k_1": [3+2]}) 195s |print(5 in s["k_0"]) # fix [] -> [5] 195s |print(5 in s["k_1"]) # update [3+2] -> [5] 195s False 195s True 195s _____________________________ test_mutable_values ______________________________ 195s 195s check_update = .w at 0x748e199285e0> 195s 195s def test_mutable_values(check_update): 195s assert ( 195s > check_update( 195s """ 195s l=[1,2] 195s assert l==snapshot() 195s l.append(3) 195s assert l==snapshot() 195s """, 195s flags="create", 195s number=2, 195s ) 195s == snapshot( 195s """\ 195s 195s l=[1,2] 195s assert l==snapshot([1, 2]) 195s l.append(3) 195s assert l==snapshot([1, 2, 3]) 195s """ 195s ) 195s ) 195s 195s tests/test_inline_snapshot.py:168: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_mutable_values0/test_1.py:11: in 195s assert l==snapshot() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_mutable_values0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s | 195s |l=[1,2] 195s |assert l==snapshot() 195s |l.append(3) 195s |assert l==snapshot() 195s _______________________________ test_comparison ________________________________ 195s 195s check_update = .w at 0x748e19855b20> 195s 195s def test_comparison(check_update): 195s > assert check_update("assert 5==snapshot()", flags="create") == snapshot( 195s "assert 5==snapshot(5)" 195s ) 195s 195s tests/test_inline_snapshot.py:257: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_comparison0/test_1.py:9: in 195s assert 5==snapshot() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_comparison0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5==snapshot() 195s ___________________________________ test_ge ____________________________________ 195s 195s check_update = .w at 0x748e19856b60> 195s 195s def test_ge(check_update): 195s > assert check_update("assert 5<=snapshot()", flags="create") == snapshot( 195s "assert 5<=snapshot(5)" 195s ) 195s 195s tests/test_inline_snapshot.py:309: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 195s new_code = self._value._new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 195s return self._file._value_to_code(self._new_value) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_ge0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5<=snapshot() 195s ___________________________________ test_le ____________________________________ 195s 195s check_update = .w at 0x748e19afaf20> 195s 195s def test_le(check_update): 195s > assert check_update("assert 5>=snapshot()", flags="create") == snapshot( 195s "assert 5>=snapshot(5)" 195s ) 195s 195s tests/test_inline_snapshot.py:381: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 195s new_code = self._value._new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 195s return self._file._value_to_code(self._new_value) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_le0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5>=snapshot() 195s ________________________________ test_contains _________________________________ 195s 195s check_update = .w at 0x748e19854540> 195s 195s def test_contains(check_update): 195s > assert check_update("assert 5 in snapshot()", flags="create") == snapshot( 195s "assert 5 in snapshot([5])" 195s ) 195s 195s tests/test_inline_snapshot.py:449: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 195s new_code = self._value._new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:411: in _new_code 195s return self._file._value_to_code(self._new_value) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '[5 ]' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_contains0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 in snapshot() 195s _________________________________ test_getitem _________________________________ 195s 195s check_update = .w at 0x748e19855da0> 195s 195s def test_getitem(check_update): 195s > assert check_update('assert 5 == snapshot()["test"]', flags="create") == snapshot( 195s 'assert 5 == snapshot({"test": 5})["test"]' 195s ) 195s 195s tests/test_inline_snapshot.py:492: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_getitem0/test_1.py:9: in 195s assert 5 == snapshot()["test"] 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_getitem0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 5 == snapshot()["test"] 195s _________________________________ test_assert __________________________________ 195s 195s check_update = .w at 0x748e19836f20> 195s 195s def test_assert(check_update): 195s > assert check_update("assert 2 == snapshot(5)", reported_flags="fix") 195s 195s tests/test_inline_snapshot.py:574: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_assert0/test_1.py:9: in 195s assert 2 == snapshot(5) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '2 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_assert0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert 2 == snapshot(5) 195s _______________________________ test_format_file _______________________________ 195s 195s check_update = .w at 0x748e19d0d4e0> 195s 195s def test_format_file(check_update): 195s > assert check_update( 195s 'assert ["aaaaaaaaaaaaaaaaa"] * 5 == snapshot()\n', flags="create" 195s ) == snapshot( 195s """\ 195s assert ["aaaaaaaaaaaaaaaaa"] * 5 == snapshot([ 195s "aaaaaaaaaaaaaaaaa", 195s "aaaaaaaaaaaaaaaaa", 195s "aaaaaaaaaaaaaaaaa", 195s "aaaaaaaaaaaaaaaaa", 195s "aaaaaaaaaaaaaaaaa", 195s ]) 195s """ 195s ) 195s 195s tests/test_inline_snapshot.py:588: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_format_file0/test_1.py:9: in 195s assert ["aaaaaaaaaaaaaaaaa"] * 5 == snapshot() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_format_file0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert ["aaaaaaaaaaaaaaaaa"] * 5 == snapshot() 195s ______________________________ test_format_value _______________________________ 195s 195s check_update = .w at 0x748e19834d60> 195s 195s def test_format_value(check_update): 195s > assert check_update( 195s 'assert ["aaaaaaaaaaaaaaaaa"] * 5== snapshot()\n', flags="create" 195s ) == snapshot( 195s """\ 195s assert ["aaaaaaaaaaaaaaaaa"] * 5== snapshot([ 195s "aaaaaaaaaaaaaaaaa", 195s "aaaaaaaaaaaaaaaaa", 195s "aaaaaaaaaaaaaaaaa", 195s "aaaaaaaaaaaaaaaaa", 195s "aaaaaaaaaaaaaaaaa", 195s ]) 195s """ 195s ) 195s 195s tests/test_inline_snapshot.py:604: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_format_value0/test_1.py:9: in 195s assert ["aaaaaaaaaaaaaaaaa"] * 5== snapshot() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_format_value0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert ["aaaaaaaaaaaaaaaaa"] * 5== snapshot() 195s _______________________________ test_type_error ________________________________ 195s 195s check_update = .w at 0x748e19855620> 195s 195s def test_type_error(check_update): 195s tests = ["5 == s", "5 <= s", "5 >= s", "5 in s", "5 == s[0]"] 195s 195s for test1, test2 in itertools.product(tests, tests): 195s with pytest.raises(TypeError) if test1 != test2 else nullcontext() as error: 195s > check_update( 195s f""" 195s s = snapshot() 195s assert {test1} 195s assert {test2} 195s """, 195s reported_flags="create", 195s ) 195s 195s tests/test_inline_snapshot.py:631: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_type_error0/test_1.py:11: in 195s assert 5 == s 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_type_error0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s | 195s |s = snapshot() 195s |assert 5 == s 195s |assert 5 == s 195s _________________________ test_different_snapshot_name _________________________ 195s 195s check_update = .w at 0x748e19837ce0> 195s 195s def test_different_snapshot_name(check_update): 195s 195s assert ( 195s > check_update( 195s """\ 195s from inline_snapshot import snapshot as s 195s assert 4==s() 195s 195s """, 195s flags="create", 195s ) 195s == snapshot( 195s """\ 195s from inline_snapshot import snapshot as s 195s assert 4==s(4) 195s 195s """ 195s ) 195s ) 195s 195s tests/test_inline_snapshot.py:695: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_different_snapshot_name0/test_1.py:10: in 195s assert 4==s() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_different_snapshot_name0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |from inline_snapshot import snapshot as s 195s |assert 4==s() 195s | 195s _______________________ test_quoting_change_is_no_update _______________________ 195s 195s source = .w at 0x748e19d0e2a0> 195s 195s def test_quoting_change_is_no_update(source): 195s 195s > s = source( 195s """\ 195s from inline_snapshot import external,snapshot 195s 195s class X: 195s def __init__(self,a): 195s self.a=a 195s pass 195s 195s def __repr__(self): 195s return f'X("{self.a}")' 195s 195s def __eq__(self,other): 195s if not hasattr(other,"a"): 195s return NotImplemented 195s return other.a==self.a 195s 195s assert X("a") == snapshot() 195s """ 195s ) 195s 195s tests/test_inline_snapshot.py:731: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_quoting_change_is_no_upda0/test_1.py:24: in 195s assert X("a") == snapshot() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_quoting_change_is_no_upda0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |from inline_snapshot import external,snapshot 195s | 195s |class X: 195s | def __init__(self,a): 195s | self.a=a 195s | pass 195s | 195s | def __repr__(self): 195s | return f'X("{self.a}")' 195s | 195s | def __eq__(self,other): 195s | if not hasattr(other,"a"): 195s | return NotImplemented 195s | return other.a==self.a 195s | 195s |assert X("a") == snapshot() 195s _____________________________ test_trailing_comma ______________________________ 195s 195s project = .Project object at 0x748e1975d910> 195s 195s def test_trailing_comma(project): 195s 195s project.setup( 195s """\ 195s from inline_snapshot import external, snapshot 195s 195s class X: 195s def __init__(self, *args): 195s self.args = args 195s 195s def __repr__(self): 195s return f"X({', '.join(map(repr,self.args))})" 195s 195s def __eq__(self,other): 195s if not isinstance(other,X): 195s return NotImplemented 195s 195s return self.args == other.args 195s 195s def test_thing(): 195s assert X("a" * 40, "a" * 40) == snapshot() 195s """ 195s ) 195s 195s > project.format() 195s 195s /tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_inline_snapshot.py:805: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py:315: in format 195s format_code(self._filename.read_text("utf-8"), self._filename), "utf-8" 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s 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' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_trailing_comma0/test_file.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s write code: 195s # äöß 🐍 195s from inline_snapshot import snapshot 195s from inline_snapshot import outsource 195s from inline_snapshot import external, snapshot 195s 195s class X: 195s def __init__(self, *args): 195s self.args = args 195s 195s def __repr__(self): 195s return f"X({', '.join(map(repr,self.args))})" 195s 195s def __eq__(self,other): 195s if not isinstance(other,X): 195s return NotImplemented 195s 195s return self.args == other.args 195s 195s def test_thing(): 195s assert X("a" * 40, "a" * 40) == snapshot() 195s 195s ___________________________________ test_is ____________________________________ 195s 195s def test_is(): 195s 195s Example( 195s """ 195s from inline_snapshot import snapshot,Is 195s 195s def test_Is(): 195s for i in range(3): 195s assert ["hello",i] == snapshot(["hi",Is(i)]) 195s assert ["hello",i] == snapshot({1:["hi",Is(i)]})[i] 195s """ 195s > ).run_inline( 195s ["--inline-snapshot=create"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s 195s from inline_snapshot import snapshot,Is 195s 195s def test_Is(): 195s for i in range(3): 195s assert ["hello",i] == snapshot(["hi",Is(i)]) 195s assert ["hello",i] == snapshot({1:["hi",Is(i)], 0: ["hello", 0], 2: ["hello", 2]})[i] 195s """ 195s } 195s ), 195s ).run_inline( 195s ["--inline-snapshot=fix"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s 195s from inline_snapshot import snapshot,Is 195s 195s def test_Is(): 195s for i in range(3): 195s assert ["hello",i] == snapshot(["hello",Is(i)]) 195s assert ["hello",i] == snapshot({1:["hello",Is(i)], 0: ["hello", 0], 2: ["hello", 2]})[i] 195s """ 195s } 195s ), 195s ) 195s 195s tests/test_inline_snapshot.py:912: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = ['--inline-snapshot=create'] 195s 195s def run_inline( 195s self, 195s args: list[str] = [], 195s *, 195s reported_categories: Snapshot[list[Category]] | None = None, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s raises: Snapshot[str] | None = None, 195s ) -> Example: 195s """Execute the example files in process and run every `test_*` 195s function. 195s 195s This is useful for fast test execution. 195s 195s Parameters: 195s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 195s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 195s changed_files: snapshot of files which are changed by this run. 195s raises: snapshot of the exception which is raised during the test execution. 195s It is required if your code raises an exception. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s parser = ArgumentParser() 195s 195s parser.add_argument( 195s "--inline-snapshot", 195s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 195s dest="inline_snapshot", 195s help="update specific snapshot values:\n" 195s "disable: disable the snapshot logic\n" 195s "short-report: show a short report\n" 195s "report: show a longer report with a diff report\n" 195s "review: allow to approve the changes interactive\n" 195s "create: creates snapshots which are currently not defined\n" 195s "update: update snapshots even if they are defined\n" 195s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 195s "fix: change snapshots which currently break your tests\n", 195s ) 195s parsed_args = parser.parse_args(args) 195s flags = (parsed_args.inline_snapshot or "").split(",") 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s 195s self._write_files(tmp_path) 195s 195s raised_exception = None 195s with snapshot_env(): 195s with ChangeRecorder().activate() as recorder: 195s _inline_snapshot._update_flags = Flags({*flags}) 195s inline_snapshot._external.storage = ( 195s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 195s ) 195s 195s try: 195s for filename in tmp_path.glob("*.py"): 195s globals: dict[str, Any] = {} 195s print("run> pytest", filename) 195s exec( 195s compile(filename.read_text("utf-8"), filename, "exec"), 195s globals, 195s ) 195s 195s # run all test_* functions 195s for k, v in globals.items(): 195s if k.startswith("test_") and callable(v): 195s v() 195s except Exception as e: 195s traceback.print_exc() 195s raised_exception = e 195s 195s finally: 195s _inline_snapshot._active = False 195s 195s changes = [] 195s for snapshot in _inline_snapshot.snapshots.values(): 195s changes += snapshot._changes() 195s 195s snapshot_flags = {change.flag for change in changes} 195s 195s apply_all( 195s [ 195s change 195s for change in changes 195s if change.flag in _inline_snapshot._update_flags.to_set() 195s ] 195s ) 195s recorder.fix_all() 195s 195s report_output = StringIO() 195s console = Console(file=report_output) 195s 195s # TODO: add all the report output here 195s report_problems(console) 195s 195s if reported_categories is not None: 195s assert sorted(snapshot_flags) == reported_categories 195s 195s if raised_exception is not None: 195s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 195s raised_exception 195s ) 195s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 195s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s 195s from inline_snapshot import snapshot,Is 195s 195s def test_Is(): 195s for i in range(3): 195s assert ["hello",i] == snapshot(["hi",Is(i)]) 195s assert ["hello",i] == snapshot({1:["hi",Is(i)]})[i] 195s 195s 195s run> pytest /tmp/tmphl2pf5kn/test_something.py 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 195s v() 195s File "/tmp/tmphl2pf5kn/test_something.py", line 6, in test_Is 195s assert ["hello",i] == snapshot(["hi",Is(i)]) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 195s return self == other 195s ^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 195s self._changes.append(next(it)) 195s ^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py", line 79, in assign 195s v = yield from self.get_adapter( 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 195s new_code = self.context.file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s _______________________________ test_missing_is ________________________________ 195s 195s def test_missing_is(): 195s 195s Example( 195s """\ 195s from inline_snapshot import snapshot 195s 195s def test_is(): 195s for i in (1,2): 195s assert i == snapshot(i) 195s """ 195s > ).run_inline( 195s raises=snapshot( 195s """\ 195s UsageError: 195s snapshot value should not change. Use Is(...) for dynamic snapshot parts.\ 195s """ 195s ) 195s ) 195s 195s tests/test_is.py:15: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 195s assert raises == f"{type(raised_exception).__name__}:\n" + str( 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 195s filename = PosixPath('/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_is.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot 195s 195s def test_is(): 195s for i in (1,2): 195s assert i == snapshot(i) 195s 195s 195s run> pytest /tmp/tmpynpcxigz/test_something.py 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 195s v() 195s File "/tmp/tmpynpcxigz/test_something.py", line 5, in test_is 195s assert i == snapshot(i) 195s ^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 195s return self == other 195s ^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 195s self._changes.append(next(it)) 195s ^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 195s new_code = self.context.file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s __________________________________ test_repr ___________________________________ 195s 195s def test_repr(): 195s Example( 195s """\ 195s from inline_snapshot import snapshot 195s from tests._is_normalized import IsNormalized 195s 195s def test_a(): 195s n=IsNormalized(sorted,snapshot()) 195s assert [3,5,2] == n 195s assert repr(n)==snapshot() 195s """ 195s > ).run_inline( 195s ["--inline-snapshot=create"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s from inline_snapshot import snapshot 195s from tests._is_normalized import IsNormalized 195s 195s def test_a(): 195s n=IsNormalized(sorted,snapshot([2, 3, 5])) 195s assert [3,5,2] == n 195s assert repr(n)==snapshot("IsNormalized([2, 3, 5], should_be=[2, 3, 5])") 195s """ 195s } 195s ), 195s ) 195s 195s tests/test_is_normalized.py:16: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = ['--inline-snapshot=create'] 195s 195s def run_inline( 195s self, 195s args: list[str] = [], 195s *, 195s reported_categories: Snapshot[list[Category]] | None = None, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s raises: Snapshot[str] | None = None, 195s ) -> Example: 195s """Execute the example files in process and run every `test_*` 195s function. 195s 195s This is useful for fast test execution. 195s 195s Parameters: 195s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 195s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 195s changed_files: snapshot of files which are changed by this run. 195s raises: snapshot of the exception which is raised during the test execution. 195s It is required if your code raises an exception. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s parser = ArgumentParser() 195s 195s parser.add_argument( 195s "--inline-snapshot", 195s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 195s dest="inline_snapshot", 195s help="update specific snapshot values:\n" 195s "disable: disable the snapshot logic\n" 195s "short-report: show a short report\n" 195s "report: show a longer report with a diff report\n" 195s "review: allow to approve the changes interactive\n" 195s "create: creates snapshots which are currently not defined\n" 195s "update: update snapshots even if they are defined\n" 195s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 195s "fix: change snapshots which currently break your tests\n", 195s ) 195s parsed_args = parser.parse_args(args) 195s flags = (parsed_args.inline_snapshot or "").split(",") 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s 195s self._write_files(tmp_path) 195s 195s raised_exception = None 195s with snapshot_env(): 195s with ChangeRecorder().activate() as recorder: 195s _inline_snapshot._update_flags = Flags({*flags}) 195s inline_snapshot._external.storage = ( 195s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 195s ) 195s 195s try: 195s for filename in tmp_path.glob("*.py"): 195s globals: dict[str, Any] = {} 195s print("run> pytest", filename) 195s exec( 195s compile(filename.read_text("utf-8"), filename, "exec"), 195s globals, 195s ) 195s 195s # run all test_* functions 195s for k, v in globals.items(): 195s if k.startswith("test_") and callable(v): 195s v() 195s except Exception as e: 195s traceback.print_exc() 195s raised_exception = e 195s 195s finally: 195s _inline_snapshot._active = False 195s 195s changes = [] 195s for snapshot in _inline_snapshot.snapshots.values(): 195s changes += snapshot._changes() 195s 195s snapshot_flags = {change.flag for change in changes} 195s 195s apply_all( 195s [ 195s change 195s for change in changes 195s if change.flag in _inline_snapshot._update_flags.to_set() 195s ] 195s ) 195s recorder.fix_all() 195s 195s report_output = StringIO() 195s console = Console(file=report_output) 195s 195s # TODO: add all the report output here 195s report_problems(console) 195s 195s if reported_categories is not None: 195s assert sorted(snapshot_flags) == reported_categories 195s 195s if raised_exception is not None: 195s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 195s raised_exception 195s ) 195s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 195s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot 195s from tests._is_normalized import IsNormalized 195s 195s def test_a(): 195s n=IsNormalized(sorted,snapshot()) 195s assert [3,5,2] == n 195s assert repr(n)==snapshot() 195s 195s 195s run> pytest /tmp/tmpwxrae4yu/test_something.py 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 195s v() 195s File "/tmp/tmpwxrae4yu/test_something.py", line 6, in test_a 195s assert [3,5,2] == n 195s ^^^^^^^^^^^^ 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/_is_normalized.py", line 13, in __eq__ 195s return self._last_value == self._value 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 195s return self == other 195s ^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 195s self._changes.append(next(it)) 195s ^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 195s new_code = self.context.file._token_to_code(new_token) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 195s return format_code(text, Path(self._source.filename)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s ______________________________ test_fix_list_fix _______________________________ 195s 195s check_update = .w at 0x748e199cab60> 195s 195s def test_fix_list_fix(check_update): 195s > assert check_update( 195s """assert [1,2]==snapshot([0+1,3])""", reported_flags="update,fix", flags="fix" 195s ) == snapshot("assert [1,2]==snapshot([0+1,2])") 195s 195s tests/test_preserve_values.py:9: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_fix_list_fix0/test_1.py:9: in 195s assert [1,2]==snapshot([0+1,3]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '1 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_list_fix0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [1,2]==snapshot([0+1,3]) 195s _____________________________ test_fix_list_insert _____________________________ 195s 195s check_update = .w at 0x748e19857100> 195s 195s def test_fix_list_insert(check_update): 195s > assert check_update( 195s """assert [1,2,3,4,5,6]==snapshot([0+1,3])""", 195s reported_flags="update,fix", 195s flags="fix", 195s ) == snapshot("assert [1,2,3,4,5,6]==snapshot([0+1, 2, 3, 4, 5, 6])") 195s 195s tests/test_preserve_values.py:15: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_fix_list_insert0/test_1.py:9: in 195s assert [1,2,3,4,5,6]==snapshot([0+1,3]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '1 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_list_insert0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [1,2,3,4,5,6]==snapshot([0+1,3]) 195s _____________________________ test_fix_list_delete _____________________________ 195s 195s check_update = .w at 0x748e19928180> 195s 195s def test_fix_list_delete(check_update): 195s > assert check_update( 195s """assert [1,5]==snapshot([0+1,2,3,4,5])""", 195s reported_flags="update,fix", 195s flags="fix", 195s ) == snapshot("assert [1,5]==snapshot([0+1, 5])") 195s 195s tests/test_preserve_values.py:23: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_fix_list_delete0/test_1.py:9: in 195s assert [1,5]==snapshot([0+1,2,3,4,5]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '1 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_list_delete0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [1,5]==snapshot([0+1,2,3,4,5]) 195s ____________________________ test_fix_tuple_delete _____________________________ 195s 195s check_update = .w at 0x748e19835800> 195s 195s def test_fix_tuple_delete(check_update): 195s > assert check_update( 195s """assert (1,5)==snapshot((0+1,2,3,4,5))""", 195s reported_flags="update,fix", 195s flags="fix", 195s ) == snapshot("assert (1,5)==snapshot((0+1, 5))") 195s 195s tests/test_preserve_values.py:31: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_fix_tuple_delete0/test_1.py:9: in 195s assert (1,5)==snapshot((0+1,2,3,4,5)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '1 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_tuple_delete0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (1,5)==snapshot((0+1,2,3,4,5)) 195s _____________________________ test_fix_dict_change _____________________________ 195s 195s check_update = .w at 0x748e19929580> 195s 195s def test_fix_dict_change(check_update): 195s > assert check_update( 195s """assert {1:1, 2:2}==snapshot({1:0+1, 2:3})""", 195s reported_flags="update,fix", 195s flags="fix", 195s ) == snapshot("assert {1:1, 2:2}==snapshot({1:0+1, 2:2})") 195s 195s tests/test_preserve_values.py:39: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_change0/test_1.py:9: in 195s assert {1:1, 2:2}==snapshot({1:0+1, 2:3}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '1 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_change0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {1:1, 2:2}==snapshot({1:0+1, 2:3}) 195s _____________________________ test_fix_dict_remove _____________________________ 195s 195s check_update = .w at 0x748e1992a2a0> 195s 195s def test_fix_dict_remove(check_update): 195s > assert check_update( 195s """assert {1:1}==snapshot({0:0, 1:0+1, 2:2})""", 195s reported_flags="update,fix", 195s flags="fix", 195s ) == snapshot("assert {1:1}==snapshot({1:0+1})") 195s 195s tests/test_preserve_values.py:47: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_remove0/test_1.py:9: in 195s assert {1:1}==snapshot({0:0, 1:0+1, 2:2}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '1 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_remove0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {1:1}==snapshot({0:0, 1:0+1, 2:2}) 195s _____________________________ test_fix_dict_insert _____________________________ 195s 195s check_update = .w at 0x748e1992ab60> 195s 195s def test_fix_dict_insert(check_update): 195s > assert check_update( 195s """assert {0:"before",1:1,2:"after"}==snapshot({1:0+1})""", 195s reported_flags="update,fix", 195s flags="fix", 195s ) == snapshot( 195s 'assert {0:"before",1:1,2:"after"}==snapshot({0: "before", 1:0+1, 2: "after"})' 195s ) 195s 195s tests/test_preserve_values.py:61: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_insert0/test_1.py:9: in 195s assert {0:"before",1:1,2:"after"}==snapshot({1:0+1}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '1 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_insert0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0:"before",1:1,2:"after"}==snapshot({1:0+1}) 195s _____________________ test_fix_dict_with_non_literal_keys ______________________ 195s 195s check_update = .w at 0x748e19929d00> 195s 195s def test_fix_dict_with_non_literal_keys(check_update): 195s > assert check_update( 195s """assert {1+2:"3"}==snapshot({1+2:"5"})""", 195s reported_flags="fix", 195s flags="fix", 195s ) == snapshot('assert {1+2:"3"}==snapshot({1+2:"3"})') 195s 195s tests/test_preserve_values.py:71: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_with_non_literal0/test_1.py:9: in 195s assert {1+2:"3"}==snapshot({1+2:"5"}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = "'3'" 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_with_non_literal0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {1+2:"3"}==snapshot({1+2:"5"}) 195s _______________________ test_no_update_for_dirty_equals ________________________ 195s 195s check_update = .w at 0x748e1992ade0> 195s 195s @pytest.mark.skipif( 195s sys.version_info < (3, 8), reason="dirty equals has dropped the 3.7 support" 195s ) 195s def test_no_update_for_dirty_equals(check_update): 195s assert ( 195s > check_update( 195s """\ 195s from dirty_equals import IsInt 195s assert {5:5,2:2}==snapshot({5:IsInt(),2:1+1}) 195s """, 195s reported_flags="update", 195s flags="update", 195s ) 195s == snapshot( 195s """\ 195s from dirty_equals import IsInt 195s assert {5:5,2:2}==snapshot({5:IsInt(),2:2}) 195s """ 195s ) 195s ) 195s 195s tests/test_preserve_values.py:83: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_no_update_for_dirty_equal0/test_1.py:10: in 195s assert {5:5,2:2}==snapshot({5:IsInt(),2:1+1}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '2 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_no_update_for_dirty_equal0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |from dirty_equals import IsInt 195s |assert {5:5,2:2}==snapshot({5:IsInt(),2:1+1}) 195s _____________________ test_preserve_case_from_original_mr ______________________ 195s 195s check_update = .w at 0x748e1992b380> 195s 195s def test_preserve_case_from_original_mr(check_update): 195s assert ( 195s > check_update( 195s """\ 195s left = { 195s "a": 1, 195s "b": { 195s "c": 2, 195s "d": [ 195s 3, 195s 4, 195s 5, 195s ], 195s }, 195s "e": ( 195s { 195s "f": 6, 195s "g": 7, 195s }, 195s ), 195s } 195s assert left == snapshot( 195s { 195s "a": 10, 195s "b": { 195s "c": 2 * 1 + 0, 195s "d": [ 195s int(3), 195s 40, 195s 5, 195s ], 195s "h": 8, 195s }, 195s "e": ( 195s { 195s "f": 3 + 3, 195s }, 195s 9, 195s ), 195s } 195s ) 195s """, 195s reported_flags="update,fix", 195s flags="fix", 195s ) 195s == snapshot( 195s """\ 195s left = { 195s "a": 1, 195s "b": { 195s "c": 2, 195s "d": [ 195s 3, 195s 4, 195s 5, 195s ], 195s }, 195s "e": ( 195s { 195s "f": 6, 195s "g": 7, 195s }, 195s ), 195s } 195s assert left == snapshot( 195s { 195s "a": 1, 195s "b": { 195s "c": 2 * 1 + 0, 195s "d": [ 195s int(3), 195s 4, 195s 5, 195s ]}, 195s "e": ({"f": 6, "g": 7},), 195s } 195s ) 195s """ 195s ) 195s ) 195s 195s tests/test_preserve_values.py:103: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_preserve_case_from_origin0/test_1.py:26: in 195s assert left == snapshot( 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '1 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_preserve_case_from_origin0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |left = { 195s | "a": 1, 195s | "b": { 195s | "c": 2, 195s | "d": [ 195s | 3, 195s | 4, 195s | 5, 195s | ], 195s | }, 195s | "e": ( 195s | { 195s | "f": 6, 195s | "g": 7, 195s | }, 195s | ), 195s |} 195s |assert left == snapshot( 195s | { 195s | "a": 10, 195s | "b": { 195s | "c": 2 * 1 + 0, 195s | "d": [ 195s | int(3), 195s | 40, 195s | 5, 195s | ], 195s | "h": 8, 195s | }, 195s | "e": ( 195s | { 195s | "f": 3 + 3, 195s | }, 195s | 9, 195s | ), 195s | } 195s |) 195s _____________________ test_generic [[5, 5, 5] -> [] ] _____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s s1 = source(code) 195s print("source:", code) 195s 195s assert set(s1.flags) == flags 195s 195s assert ("fix" in flags) == s1.error 195s 195s for f in all_flags: 195s c3 = build( 195s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 195s ) 195s new_code = f"assert {c2}==snapshot({c3})" 195s 195s print(f"{set(f)}:") 195s print(" ", code) 195s print(" ", new_code) 195s > s2 = s1.run(*f) 195s 195s tests/test_preserve_values.py:245: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:137: in run 195s recorder.fix_all() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 195s file.rewrite() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 195s new_code = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s 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])' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_3.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert []==snapshot([5, 5, 5]) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert []==snapshot([5, 5, 5]) 195s source: assert []==snapshot([5, 5, 5]) 195s set(): 195s assert []==snapshot([5, 5, 5]) 195s assert []==snapshot([5, 5, 5]) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert []==snapshot([5, 5, 5]) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert []==snapshot([5, 5, 5]) 195s {'fix'}: 195s assert []==snapshot([5, 5, 5]) 195s assert []==snapshot([]) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert []==snapshot([5, 5, 5]) 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_1.py", line 9, in 195s assert []==snapshot([5, 5, 5]) 195s ^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_2.py", line 9, in 195s assert []==snapshot([5, 5, 5]) 195s ^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________________ test_generic [[5, 5] -> [8] ] ______________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_4.py:9: in 195s assert [8]==snapshot([5, 5]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_4.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [8]==snapshot([5, 5]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [[5, 5, 2+2] -> [4] ] ________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_5.py:9: in 195s assert [4]==snapshot([5, 5, 2+2]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_5.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [4]==snapshot([5, 5, 2+2]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________________ test_generic [[5, 5, 3] -> [3] ] _____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s s1 = source(code) 195s print("source:", code) 195s 195s assert set(s1.flags) == flags 195s 195s assert ("fix" in flags) == s1.error 195s 195s for f in all_flags: 195s c3 = build( 195s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 195s ) 195s new_code = f"assert {c2}==snapshot({c3})" 195s 195s print(f"{set(f)}:") 195s print(" ", code) 195s print(" ", new_code) 195s > s2 = s1.run(*f) 195s 195s tests/test_preserve_values.py:245: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:137: in run 195s recorder.fix_all() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 195s file.rewrite() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 195s new_code = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s 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])' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_8.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3]==snapshot([5, 5, 3]) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert [3]==snapshot([5, 5, 3]) 195s source: assert [3]==snapshot([5, 5, 3]) 195s set(): 195s assert [3]==snapshot([5, 5, 3]) 195s assert [3]==snapshot([5, 5, 3]) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3]==snapshot([5, 5, 3]) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert [3]==snapshot([5, 5, 3]) 195s {'fix'}: 195s assert [3]==snapshot([5, 5, 3]) 195s assert [3]==snapshot([3]) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3]==snapshot([5, 5, 3]) 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_6.py", line 9, in 195s assert [3]==snapshot([5, 5, 3]) 195s ^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_7.py", line 9, in 195s assert [3]==snapshot([5, 5, 3]) 195s ^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________________ test_generic [[5, 5] -> [8] ] ______________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_9.py:9: in 195s assert [8]==snapshot([5, 5]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_9.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [8]==snapshot([5, 5]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________________ test_generic [[5] -> [8, 8] ] ______________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_10.py:9: in 195s assert [8, 8]==snapshot([5]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_10.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [8, 8]==snapshot([5]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [[5, 2+2] -> [8, 4] ] ________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_11.py:9: in 195s assert [8, 4]==snapshot([5, 2+2]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_11.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [8, 4]==snapshot([5, 2+2]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________________ test_generic [[5, 3] -> [8, 3] ] _____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_12.py:9: in 195s assert [8, 3]==snapshot([5, 3]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_12.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [8, 3]==snapshot([5, 3]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [[5, 2+2, 5] -> [4] ] ________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_13.py:9: in 195s assert [4]==snapshot([5, 2+2, 5]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_13.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [4]==snapshot([5, 2+2, 5]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [[5, 2+2] -> [4, 8] ] ________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_14.py:9: in 195s assert [4, 8]==snapshot([5, 2+2]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_14.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [4, 8]==snapshot([5, 2+2]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____________ test_generic [[5, 2+2, 2+2] -> [4, 4] ] _____________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_15.py:9: in 195s assert [4, 4]==snapshot([5, 2+2, 2+2]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_15.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [4, 4]==snapshot([5, 2+2, 2+2]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [[5, 2+2, 3] -> [4, 3] ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_16.py:9: in 195s assert [4, 3]==snapshot([5, 2+2, 3]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_16.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [4, 3]==snapshot([5, 2+2, 3]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________________ test_generic [[5, 3, 5] -> [3] ] _____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s s1 = source(code) 195s print("source:", code) 195s 195s assert set(s1.flags) == flags 195s 195s assert ("fix" in flags) == s1.error 195s 195s for f in all_flags: 195s c3 = build( 195s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 195s ) 195s new_code = f"assert {c2}==snapshot({c3})" 195s 195s print(f"{set(f)}:") 195s print(" ", code) 195s print(" ", new_code) 195s > s2 = s1.run(*f) 195s 195s tests/test_preserve_values.py:245: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:137: in run 195s recorder.fix_all() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 195s file.rewrite() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 195s new_code = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s 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])' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_19.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3]==snapshot([5, 3, 5]) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert [3]==snapshot([5, 3, 5]) 195s source: assert [3]==snapshot([5, 3, 5]) 195s set(): 195s assert [3]==snapshot([5, 3, 5]) 195s assert [3]==snapshot([5, 3, 5]) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3]==snapshot([5, 3, 5]) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert [3]==snapshot([5, 3, 5]) 195s {'fix'}: 195s assert [3]==snapshot([5, 3, 5]) 195s assert [3]==snapshot([3]) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3]==snapshot([5, 3, 5]) 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_17.py", line 9, in 195s assert [3]==snapshot([5, 3, 5]) 195s ^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_18.py", line 9, in 195s assert [3]==snapshot([5, 3, 5]) 195s ^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________________ test_generic [[5, 3] -> [3, 8] ] _____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_20.py:9: in 195s assert [3, 8]==snapshot([5, 3]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_20.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3, 8]==snapshot([5, 3]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [[5, 3, 2+2] -> [3, 4] ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_21.py:9: in 195s assert [3, 4]==snapshot([5, 3, 2+2]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_21.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3, 4]==snapshot([5, 3, 2+2]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ___________________ test_generic [[5, 3, 3] -> [3, 3] ] ___________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s s1 = source(code) 195s print("source:", code) 195s 195s assert set(s1.flags) == flags 195s 195s assert ("fix" in flags) == s1.error 195s 195s for f in all_flags: 195s c3 = build( 195s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 195s ) 195s new_code = f"assert {c2}==snapshot({c3})" 195s 195s print(f"{set(f)}:") 195s print(" ", code) 195s print(" ", new_code) 195s > s2 = s1.run(*f) 195s 195s tests/test_preserve_values.py:245: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:137: in run 195s recorder.fix_all() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 195s file.rewrite() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 195s new_code = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s 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])' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_24.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3, 3]==snapshot([5, 3, 3]) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert [3, 3]==snapshot([5, 3, 3]) 195s source: assert [3, 3]==snapshot([5, 3, 3]) 195s set(): 195s assert [3, 3]==snapshot([5, 3, 3]) 195s assert [3, 3]==snapshot([5, 3, 3]) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3, 3]==snapshot([5, 3, 3]) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert [3, 3]==snapshot([5, 3, 3]) 195s {'fix'}: 195s assert [3, 3]==snapshot([5, 3, 3]) 195s assert [3, 3]==snapshot([3, 3]) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3, 3]==snapshot([5, 3, 3]) 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_22.py", line 9, in 195s assert [3, 3]==snapshot([5, 3, 3]) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_23.py", line 9, in 195s assert [3, 3]==snapshot([5, 3, 3]) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________________ test_generic [[5, 5] -> [8] ] ______________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_25.py:9: in 195s assert [8]==snapshot([5, 5]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_25.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [8]==snapshot([5, 5]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________________ test_generic [[5] -> [8, 8] ] ______________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_26.py:9: in 195s assert [8, 8]==snapshot([5]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_26.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [8, 8]==snapshot([5]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [[5, 2+2] -> [8, 4] ] ________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_27.py:9: in 195s assert [8, 4]==snapshot([5, 2+2]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_27.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [8, 4]==snapshot([5, 2+2]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________________ test_generic [[5, 3] -> [8, 3] ] _____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_28.py:9: in 195s assert [8, 3]==snapshot([5, 3]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_28.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [8, 3]==snapshot([5, 3]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________________ test_generic [[5] -> [8, 8] ] ______________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_29.py:9: in 195s assert [8, 8]==snapshot([5]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_29.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [8, 8]==snapshot([5]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____________________ test_generic [[] -> [8, 8, 8] ] _____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_30.py:9: in 195s assert [8, 8, 8]==snapshot([]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_30.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [8, 8, 8]==snapshot([]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [[2+2] -> [8, 8, 4] ] ________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_31.py:9: in 195s assert [8, 8, 4]==snapshot([2+2]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_31.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [8, 8, 4]==snapshot([2+2]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________________ test_generic [[3] -> [8, 8, 3] ] _____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_32.py:9: in 195s assert [8, 8, 3]==snapshot([3]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_32.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [8, 8, 3]==snapshot([3]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [[2+2, 5] -> [8, 4] ] ________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_33.py:9: in 195s assert [8, 4]==snapshot([2+2, 5]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_33.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [8, 4]==snapshot([2+2, 5]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [[2+2] -> [8, 4, 8] ] ________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_34.py:9: in 195s assert [8, 4, 8]==snapshot([2+2]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_34.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [8, 4, 8]==snapshot([2+2]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____________ test_generic [[2+2, 2+2] -> [8, 4, 4] ] _____________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_35.py:9: in 195s assert [8, 4, 4]==snapshot([2+2, 2+2]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_35.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [8, 4, 4]==snapshot([2+2, 2+2]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [[2+2, 3] -> [8, 4, 3] ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_36.py:9: in 195s assert [8, 4, 3]==snapshot([2+2, 3]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_36.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [8, 4, 3]==snapshot([2+2, 3]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________________ test_generic [[3, 5] -> [8, 3] ] _____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_37.py:9: in 195s assert [8, 3]==snapshot([3, 5]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_37.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [8, 3]==snapshot([3, 5]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________________ test_generic [[3] -> [8, 3, 8] ] _____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_38.py:9: in 195s assert [8, 3, 8]==snapshot([3]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_38.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [8, 3, 8]==snapshot([3]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [[3, 2+2] -> [8, 3, 4] ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_39.py:9: in 195s assert [8, 3, 4]==snapshot([3, 2+2]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_39.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [8, 3, 4]==snapshot([3, 2+2]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ___________________ test_generic [[3, 3] -> [8, 3, 3] ] ___________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_40.py:9: in 195s assert [8, 3, 3]==snapshot([3, 3]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_40.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [8, 3, 3]==snapshot([3, 3]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [[2+2, 5, 5] -> [4] ] ________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_41.py:9: in 195s assert [4]==snapshot([2+2, 5, 5]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_41.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [4]==snapshot([2+2, 5, 5]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [[2+2, 5] -> [4, 8] ] ________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_42.py:9: in 195s assert [4, 8]==snapshot([2+2, 5]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_42.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [4, 8]==snapshot([2+2, 5]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____________ test_generic [[2+2, 5, 2+2] -> [4, 4] ] _____________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_43.py:9: in 195s assert [4, 4]==snapshot([2+2, 5, 2+2]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_43.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [4, 4]==snapshot([2+2, 5, 2+2]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [[2+2, 5, 3] -> [4, 3] ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_44.py:9: in 195s assert [4, 3]==snapshot([2+2, 5, 3]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_44.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [4, 3]==snapshot([2+2, 5, 3]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [[2+2, 5] -> [4, 8] ] ________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_45.py:9: in 195s assert [4, 8]==snapshot([2+2, 5]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_45.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [4, 8]==snapshot([2+2, 5]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [[2+2] -> [4, 8, 8] ] ________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_46.py:9: in 195s assert [4, 8, 8]==snapshot([2+2]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_46.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [4, 8, 8]==snapshot([2+2]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____________ test_generic [[2+2, 2+2] -> [4, 8, 4] ] _____________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_47.py:9: in 195s assert [4, 8, 4]==snapshot([2+2, 2+2]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_47.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [4, 8, 4]==snapshot([2+2, 2+2]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [[2+2, 3] -> [4, 8, 3] ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_48.py:9: in 195s assert [4, 8, 3]==snapshot([2+2, 3]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_48.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [4, 8, 3]==snapshot([2+2, 3]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____________ test_generic [[2+2, 2+2, 5] -> [4, 4] ] _____________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_49.py:9: in 195s assert [4, 4]==snapshot([2+2, 2+2, 5]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_49.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [4, 4]==snapshot([2+2, 2+2, 5]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____________ test_generic [[2+2, 2+2] -> [4, 4, 8] ] _____________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_50.py:9: in 195s assert [4, 4, 8]==snapshot([2+2, 2+2]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_50.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [4, 4, 8]==snapshot([2+2, 2+2]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____________ test_generic [[2+2, 2+2, 2+2] -> [4, 4, 4] ] _____________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_51.py:9: in 195s assert [4, 4, 4]==snapshot([2+2, 2+2, 2+2]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_51.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [4, 4, 4]==snapshot([2+2, 2+2, 2+2]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [[2+2, 2+2, 3] -> [4, 4, 3] ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_52.py:9: in 195s assert [4, 4, 3]==snapshot([2+2, 2+2, 3]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_52.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [4, 4, 3]==snapshot([2+2, 2+2, 3]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [[2+2, 3, 5] -> [4, 3] ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_53.py:9: in 195s assert [4, 3]==snapshot([2+2, 3, 5]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_53.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [4, 3]==snapshot([2+2, 3, 5]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [[2+2, 3] -> [4, 3, 8] ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_54.py:9: in 195s assert [4, 3, 8]==snapshot([2+2, 3]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_54.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [4, 3, 8]==snapshot([2+2, 3]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [[2+2, 3, 2+2] -> [4, 3, 4] ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_55.py:9: in 195s assert [4, 3, 4]==snapshot([2+2, 3, 2+2]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_55.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [4, 3, 4]==snapshot([2+2, 3, 2+2]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [[2+2, 3, 3] -> [4, 3, 3] ] _______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_56.py:9: in 195s assert [4, 3, 3]==snapshot([2+2, 3, 3]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_56.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [4, 3, 3]==snapshot([2+2, 3, 3]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________________ test_generic [[3, 5, 5] -> [3] ] _____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s s1 = source(code) 195s print("source:", code) 195s 195s assert set(s1.flags) == flags 195s 195s assert ("fix" in flags) == s1.error 195s 195s for f in all_flags: 195s c3 = build( 195s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 195s ) 195s new_code = f"assert {c2}==snapshot({c3})" 195s 195s print(f"{set(f)}:") 195s print(" ", code) 195s print(" ", new_code) 195s > s2 = s1.run(*f) 195s 195s tests/test_preserve_values.py:245: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:137: in run 195s recorder.fix_all() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 195s file.rewrite() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 195s new_code = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s 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])' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_59.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3]==snapshot([3, 5, 5]) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert [3]==snapshot([3, 5, 5]) 195s source: assert [3]==snapshot([3, 5, 5]) 195s set(): 195s assert [3]==snapshot([3, 5, 5]) 195s assert [3]==snapshot([3, 5, 5]) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3]==snapshot([3, 5, 5]) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert [3]==snapshot([3, 5, 5]) 195s {'fix'}: 195s assert [3]==snapshot([3, 5, 5]) 195s assert [3]==snapshot([3]) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3]==snapshot([3, 5, 5]) 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_57.py", line 9, in 195s assert [3]==snapshot([3, 5, 5]) 195s ^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_58.py", line 9, in 195s assert [3]==snapshot([3, 5, 5]) 195s ^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________________ test_generic [[3, 5] -> [3, 8] ] _____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_60.py:9: in 195s assert [3, 8]==snapshot([3, 5]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_60.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3, 8]==snapshot([3, 5]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [[3, 5, 2+2] -> [3, 4] ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_61.py:9: in 195s assert [3, 4]==snapshot([3, 5, 2+2]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_61.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3, 4]==snapshot([3, 5, 2+2]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ___________________ test_generic [[3, 5, 3] -> [3, 3] ] ___________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s s1 = source(code) 195s print("source:", code) 195s 195s assert set(s1.flags) == flags 195s 195s assert ("fix" in flags) == s1.error 195s 195s for f in all_flags: 195s c3 = build( 195s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 195s ) 195s new_code = f"assert {c2}==snapshot({c3})" 195s 195s print(f"{set(f)}:") 195s print(" ", code) 195s print(" ", new_code) 195s > s2 = s1.run(*f) 195s 195s tests/test_preserve_values.py:245: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:137: in run 195s recorder.fix_all() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 195s file.rewrite() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 195s new_code = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s 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])' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_64.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3, 3]==snapshot([3, 5, 3]) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert [3, 3]==snapshot([3, 5, 3]) 195s source: assert [3, 3]==snapshot([3, 5, 3]) 195s set(): 195s assert [3, 3]==snapshot([3, 5, 3]) 195s assert [3, 3]==snapshot([3, 5, 3]) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3, 3]==snapshot([3, 5, 3]) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert [3, 3]==snapshot([3, 5, 3]) 195s {'fix'}: 195s assert [3, 3]==snapshot([3, 5, 3]) 195s assert [3, 3]==snapshot([3, 3]) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3, 3]==snapshot([3, 5, 3]) 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_62.py", line 9, in 195s assert [3, 3]==snapshot([3, 5, 3]) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_63.py", line 9, in 195s assert [3, 3]==snapshot([3, 5, 3]) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________________ test_generic [[3, 5] -> [3, 8] ] _____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_65.py:9: in 195s assert [3, 8]==snapshot([3, 5]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_65.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3, 8]==snapshot([3, 5]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________________ test_generic [[3] -> [3, 8, 8] ] _____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_66.py:9: in 195s assert [3, 8, 8]==snapshot([3]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_66.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3, 8, 8]==snapshot([3]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [[3, 2+2] -> [3, 8, 4] ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_67.py:9: in 195s assert [3, 8, 4]==snapshot([3, 2+2]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_67.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3, 8, 4]==snapshot([3, 2+2]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ___________________ test_generic [[3, 3] -> [3, 8, 3] ] ___________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_68.py:9: in 195s assert [3, 8, 3]==snapshot([3, 3]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_68.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3, 8, 3]==snapshot([3, 3]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [[3, 2+2, 5] -> [3, 4] ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_69.py:9: in 195s assert [3, 4]==snapshot([3, 2+2, 5]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_69.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3, 4]==snapshot([3, 2+2, 5]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [[3, 2+2] -> [3, 4, 8] ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_70.py:9: in 195s assert [3, 4, 8]==snapshot([3, 2+2]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_70.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3, 4, 8]==snapshot([3, 2+2]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [[3, 2+2, 2+2] -> [3, 4, 4] ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_71.py:9: in 195s assert [3, 4, 4]==snapshot([3, 2+2, 2+2]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_71.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3, 4, 4]==snapshot([3, 2+2, 2+2]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [[3, 2+2, 3] -> [3, 4, 3] ] _______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_72.py:9: in 195s assert [3, 4, 3]==snapshot([3, 2+2, 3]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_72.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3, 4, 3]==snapshot([3, 2+2, 3]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ___________________ test_generic [[3, 3, 5] -> [3, 3] ] ___________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s s1 = source(code) 195s print("source:", code) 195s 195s assert set(s1.flags) == flags 195s 195s assert ("fix" in flags) == s1.error 195s 195s for f in all_flags: 195s c3 = build( 195s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 195s ) 195s new_code = f"assert {c2}==snapshot({c3})" 195s 195s print(f"{set(f)}:") 195s print(" ", code) 195s print(" ", new_code) 195s > s2 = s1.run(*f) 195s 195s tests/test_preserve_values.py:245: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:137: in run 195s recorder.fix_all() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 195s file.rewrite() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 195s new_code = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s 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])' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_75.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3, 3]==snapshot([3, 3, 5]) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert [3, 3]==snapshot([3, 3, 5]) 195s source: assert [3, 3]==snapshot([3, 3, 5]) 195s set(): 195s assert [3, 3]==snapshot([3, 3, 5]) 195s assert [3, 3]==snapshot([3, 3, 5]) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3, 3]==snapshot([3, 3, 5]) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert [3, 3]==snapshot([3, 3, 5]) 195s {'fix'}: 195s assert [3, 3]==snapshot([3, 3, 5]) 195s assert [3, 3]==snapshot([3, 3]) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3, 3]==snapshot([3, 3, 5]) 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_73.py", line 9, in 195s assert [3, 3]==snapshot([3, 3, 5]) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_74.py", line 9, in 195s assert [3, 3]==snapshot([3, 3, 5]) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s ------------------------------ Captured log call ------------------------------- 195s 195s ___________________ test_generic [[3, 3] -> [3, 3, 8] ] ___________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_76.py:9: in 195s assert [3, 3, 8]==snapshot([3, 3]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_76.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3, 3, 8]==snapshot([3, 3]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [[3, 3, 2+2] -> [3, 3, 4] ] _______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_77.py:9: in 195s assert [3, 3, 4]==snapshot([3, 3, 2+2]) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_77.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert [3, 3, 4]==snapshot([3, 3, 2+2]) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____________________ test_generic [(5, 5, 5) -> () ] _____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s s1 = source(code) 195s print("source:", code) 195s 195s assert set(s1.flags) == flags 195s 195s assert ("fix" in flags) == s1.error 195s 195s for f in all_flags: 195s c3 = build( 195s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 195s ) 195s new_code = f"assert {c2}==snapshot({c3})" 195s 195s print(f"{set(f)}:") 195s print(" ", code) 195s print(" ", new_code) 195s > s2 = s1.run(*f) 195s 195s tests/test_preserve_values.py:245: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:137: in run 195s recorder.fix_all() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 195s file.rewrite() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 195s new_code = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s 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))' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_82.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert ()==snapshot((5, 5, 5)) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert ()==snapshot((5, 5, 5)) 195s source: assert ()==snapshot((5, 5, 5)) 195s set(): 195s assert ()==snapshot((5, 5, 5)) 195s assert ()==snapshot((5, 5, 5)) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert ()==snapshot((5, 5, 5)) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert ()==snapshot((5, 5, 5)) 195s {'fix'}: 195s assert ()==snapshot((5, 5, 5)) 195s assert ()==snapshot(()) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert ()==snapshot((5, 5, 5)) 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_80.py", line 9, in 195s assert ()==snapshot((5, 5, 5)) 195s ^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_81.py", line 9, in 195s assert ()==snapshot((5, 5, 5)) 195s ^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____________________ test_generic [(5, 5) -> (8,) ] ______________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_83.py:9: in 195s assert (8,)==snapshot((5, 5)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_83.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (8,)==snapshot((5, 5)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [(5, 5, 2+2) -> (4,) ] _______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_84.py:9: in 195s assert (4,)==snapshot((5, 5, 2+2)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_84.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (4,)==snapshot((5, 5, 2+2)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________________ test_generic [(5, 5, 3) -> (3,) ] ____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s s1 = source(code) 195s print("source:", code) 195s 195s assert set(s1.flags) == flags 195s 195s assert ("fix" in flags) == s1.error 195s 195s for f in all_flags: 195s c3 = build( 195s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 195s ) 195s new_code = f"assert {c2}==snapshot({c3})" 195s 195s print(f"{set(f)}:") 195s print(" ", code) 195s print(" ", new_code) 195s > s2 = s1.run(*f) 195s 195s tests/test_preserve_values.py:245: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:137: in run 195s recorder.fix_all() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 195s file.rewrite() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 195s new_code = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s 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))' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_87.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3,)==snapshot((5, 5, 3)) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert (3,)==snapshot((5, 5, 3)) 195s source: assert (3,)==snapshot((5, 5, 3)) 195s set(): 195s assert (3,)==snapshot((5, 5, 3)) 195s assert (3,)==snapshot((5, 5, 3)) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3,)==snapshot((5, 5, 3)) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert (3,)==snapshot((5, 5, 3)) 195s {'fix'}: 195s assert (3,)==snapshot((5, 5, 3)) 195s assert (3,)==snapshot((3,)) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3,)==snapshot((5, 5, 3)) 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_85.py", line 9, in 195s assert (3,)==snapshot((5, 5, 3)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_86.py", line 9, in 195s assert (3,)==snapshot((5, 5, 3)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____________________ test_generic [(5, 5) -> (8,) ] ______________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_88.py:9: in 195s assert (8,)==snapshot((5, 5)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_88.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (8,)==snapshot((5, 5)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____________________ test_generic [(5,) -> (8, 8) ] ______________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_89.py:9: in 195s assert (8, 8)==snapshot((5,)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_89.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (8, 8)==snapshot((5,)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [(5, 2+2) -> (8, 4) ] ________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_90.py:9: in 195s assert (8, 4)==snapshot((5, 2+2)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_90.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (8, 4)==snapshot((5, 2+2)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________________ test_generic [(5, 3) -> (8, 3) ] _____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_91.py:9: in 195s assert (8, 3)==snapshot((5, 3)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_91.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (8, 3)==snapshot((5, 3)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [(5, 2+2, 5) -> (4,) ] _______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_92.py:9: in 195s assert (4,)==snapshot((5, 2+2, 5)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_92.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (4,)==snapshot((5, 2+2, 5)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [(5, 2+2) -> (4, 8) ] ________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_93.py:9: in 195s assert (4, 8)==snapshot((5, 2+2)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_93.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (4, 8)==snapshot((5, 2+2)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____________ test_generic [(5, 2+2, 2+2) -> (4, 4) ] _____________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_94.py:9: in 195s assert (4, 4)==snapshot((5, 2+2, 2+2)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_94.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (4, 4)==snapshot((5, 2+2, 2+2)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [(5, 2+2, 3) -> (4, 3) ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_95.py:9: in 195s assert (4, 3)==snapshot((5, 2+2, 3)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_95.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (4, 3)==snapshot((5, 2+2, 3)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________________ test_generic [(5, 3, 5) -> (3,) ] ____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s s1 = source(code) 195s print("source:", code) 195s 195s assert set(s1.flags) == flags 195s 195s assert ("fix" in flags) == s1.error 195s 195s for f in all_flags: 195s c3 = build( 195s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 195s ) 195s new_code = f"assert {c2}==snapshot({c3})" 195s 195s print(f"{set(f)}:") 195s print(" ", code) 195s print(" ", new_code) 195s > s2 = s1.run(*f) 195s 195s tests/test_preserve_values.py:245: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:137: in run 195s recorder.fix_all() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 195s file.rewrite() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 195s new_code = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s 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))' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_98.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3,)==snapshot((5, 3, 5)) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert (3,)==snapshot((5, 3, 5)) 195s source: assert (3,)==snapshot((5, 3, 5)) 195s set(): 195s assert (3,)==snapshot((5, 3, 5)) 195s assert (3,)==snapshot((5, 3, 5)) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3,)==snapshot((5, 3, 5)) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert (3,)==snapshot((5, 3, 5)) 195s {'fix'}: 195s assert (3,)==snapshot((5, 3, 5)) 195s assert (3,)==snapshot((3,)) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3,)==snapshot((5, 3, 5)) 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_96.py", line 9, in 195s assert (3,)==snapshot((5, 3, 5)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_97.py", line 9, in 195s assert (3,)==snapshot((5, 3, 5)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________________ test_generic [(5, 3) -> (3, 8) ] _____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_99.py:9: in 195s assert (3, 8)==snapshot((5, 3)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_99.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3, 8)==snapshot((5, 3)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [(5, 3, 2+2) -> (3, 4) ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_100.py:9: in 195s assert (3, 4)==snapshot((5, 3, 2+2)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_100.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3, 4)==snapshot((5, 3, 2+2)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ___________________ test_generic [(5, 3, 3) -> (3, 3) ] ___________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s s1 = source(code) 195s print("source:", code) 195s 195s assert set(s1.flags) == flags 195s 195s assert ("fix" in flags) == s1.error 195s 195s for f in all_flags: 195s c3 = build( 195s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 195s ) 195s new_code = f"assert {c2}==snapshot({c3})" 195s 195s print(f"{set(f)}:") 195s print(" ", code) 195s print(" ", new_code) 195s > s2 = s1.run(*f) 195s 195s tests/test_preserve_values.py:245: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:137: in run 195s recorder.fix_all() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 195s file.rewrite() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 195s new_code = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s 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))' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_103.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3, 3)==snapshot((5, 3, 3)) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert (3, 3)==snapshot((5, 3, 3)) 195s source: assert (3, 3)==snapshot((5, 3, 3)) 195s set(): 195s assert (3, 3)==snapshot((5, 3, 3)) 195s assert (3, 3)==snapshot((5, 3, 3)) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3, 3)==snapshot((5, 3, 3)) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert (3, 3)==snapshot((5, 3, 3)) 195s {'fix'}: 195s assert (3, 3)==snapshot((5, 3, 3)) 195s assert (3, 3)==snapshot((3, 3)) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3, 3)==snapshot((5, 3, 3)) 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_101.py", line 9, in 195s assert (3, 3)==snapshot((5, 3, 3)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_102.py", line 9, in 195s assert (3, 3)==snapshot((5, 3, 3)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____________________ test_generic [(5, 5) -> (8,) ] ______________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_104.py:9: in 195s assert (8,)==snapshot((5, 5)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_104.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (8,)==snapshot((5, 5)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____________________ test_generic [(5,) -> (8, 8) ] ______________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_105.py:9: in 195s assert (8, 8)==snapshot((5,)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_105.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (8, 8)==snapshot((5,)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [(5, 2+2) -> (8, 4) ] ________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_106.py:9: in 195s assert (8, 4)==snapshot((5, 2+2)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_106.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (8, 4)==snapshot((5, 2+2)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________________ test_generic [(5, 3) -> (8, 3) ] _____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_107.py:9: in 195s assert (8, 3)==snapshot((5, 3)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_107.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (8, 3)==snapshot((5, 3)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____________________ test_generic [(5,) -> (8, 8) ] ______________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_108.py:9: in 195s assert (8, 8)==snapshot((5,)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_108.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (8, 8)==snapshot((5,)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____________________ test_generic [() -> (8, 8, 8) ] _____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_109.py:9: in 195s assert (8, 8, 8)==snapshot(()) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_109.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (8, 8, 8)==snapshot(()) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [(2+2,) -> (8, 8, 4) ] _______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_110.py:9: in 195s assert (8, 8, 4)==snapshot((2+2,)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_110.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (8, 8, 4)==snapshot((2+2,)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________________ test_generic [(3,) -> (8, 8, 3) ] ____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_111.py:9: in 195s assert (8, 8, 3)==snapshot((3,)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_111.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (8, 8, 3)==snapshot((3,)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [(2+2, 5) -> (8, 4) ] ________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_112.py:9: in 195s assert (8, 4)==snapshot((2+2, 5)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_112.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (8, 4)==snapshot((2+2, 5)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [(2+2,) -> (8, 4, 8) ] _______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_113.py:9: in 195s assert (8, 4, 8)==snapshot((2+2,)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_113.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (8, 4, 8)==snapshot((2+2,)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____________ test_generic [(2+2, 2+2) -> (8, 4, 4) ] _____________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_114.py:9: in 195s assert (8, 4, 4)==snapshot((2+2, 2+2)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_114.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (8, 4, 4)==snapshot((2+2, 2+2)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [(2+2, 3) -> (8, 4, 3) ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_115.py:9: in 195s assert (8, 4, 3)==snapshot((2+2, 3)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_115.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (8, 4, 3)==snapshot((2+2, 3)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________________ test_generic [(3, 5) -> (8, 3) ] _____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_116.py:9: in 195s assert (8, 3)==snapshot((3, 5)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_116.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (8, 3)==snapshot((3, 5)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________________ test_generic [(3,) -> (8, 3, 8) ] ____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_117.py:9: in 195s assert (8, 3, 8)==snapshot((3,)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_117.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (8, 3, 8)==snapshot((3,)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [(3, 2+2) -> (8, 3, 4) ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_118.py:9: in 195s assert (8, 3, 4)==snapshot((3, 2+2)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_118.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (8, 3, 4)==snapshot((3, 2+2)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ___________________ test_generic [(3, 3) -> (8, 3, 3) ] ___________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_119.py:9: in 195s assert (8, 3, 3)==snapshot((3, 3)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_119.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (8, 3, 3)==snapshot((3, 3)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [(2+2, 5, 5) -> (4,) ] _______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_120.py:9: in 195s assert (4,)==snapshot((2+2, 5, 5)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_120.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (4,)==snapshot((2+2, 5, 5)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [(2+2, 5) -> (4, 8) ] ________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_121.py:9: in 195s assert (4, 8)==snapshot((2+2, 5)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_121.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (4, 8)==snapshot((2+2, 5)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____________ test_generic [(2+2, 5, 2+2) -> (4, 4) ] _____________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_122.py:9: in 195s assert (4, 4)==snapshot((2+2, 5, 2+2)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_122.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (4, 4)==snapshot((2+2, 5, 2+2)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [(2+2, 5, 3) -> (4, 3) ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_123.py:9: in 195s assert (4, 3)==snapshot((2+2, 5, 3)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_123.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (4, 3)==snapshot((2+2, 5, 3)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [(2+2, 5) -> (4, 8) ] ________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_124.py:9: in 195s assert (4, 8)==snapshot((2+2, 5)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_124.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (4, 8)==snapshot((2+2, 5)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [(2+2,) -> (4, 8, 8) ] _______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_125.py:9: in 195s assert (4, 8, 8)==snapshot((2+2,)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_125.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (4, 8, 8)==snapshot((2+2,)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____________ test_generic [(2+2, 2+2) -> (4, 8, 4) ] _____________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_126.py:9: in 195s assert (4, 8, 4)==snapshot((2+2, 2+2)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_126.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (4, 8, 4)==snapshot((2+2, 2+2)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [(2+2, 3) -> (4, 8, 3) ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_127.py:9: in 195s assert (4, 8, 3)==snapshot((2+2, 3)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_127.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (4, 8, 3)==snapshot((2+2, 3)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____________ test_generic [(2+2, 2+2, 5) -> (4, 4) ] _____________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_128.py:9: in 195s assert (4, 4)==snapshot((2+2, 2+2, 5)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_128.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (4, 4)==snapshot((2+2, 2+2, 5)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____________ test_generic [(2+2, 2+2) -> (4, 4, 8) ] _____________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_129.py:9: in 195s assert (4, 4, 8)==snapshot((2+2, 2+2)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_129.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (4, 4, 8)==snapshot((2+2, 2+2)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____________ test_generic [(2+2, 2+2, 2+2) -> (4, 4, 4) ] _____________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_130.py:9: in 195s assert (4, 4, 4)==snapshot((2+2, 2+2, 2+2)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_130.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (4, 4, 4)==snapshot((2+2, 2+2, 2+2)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [(2+2, 2+2, 3) -> (4, 4, 3) ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_131.py:9: in 195s assert (4, 4, 3)==snapshot((2+2, 2+2, 3)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_131.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (4, 4, 3)==snapshot((2+2, 2+2, 3)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [(2+2, 3, 5) -> (4, 3) ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_132.py:9: in 195s assert (4, 3)==snapshot((2+2, 3, 5)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_132.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (4, 3)==snapshot((2+2, 3, 5)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [(2+2, 3) -> (4, 3, 8) ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_133.py:9: in 195s assert (4, 3, 8)==snapshot((2+2, 3)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_133.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (4, 3, 8)==snapshot((2+2, 3)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [(2+2, 3, 2+2) -> (4, 3, 4) ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_134.py:9: in 195s assert (4, 3, 4)==snapshot((2+2, 3, 2+2)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_134.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (4, 3, 4)==snapshot((2+2, 3, 2+2)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [(2+2, 3, 3) -> (4, 3, 3) ] _______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_135.py:9: in 195s assert (4, 3, 3)==snapshot((2+2, 3, 3)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_135.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (4, 3, 3)==snapshot((2+2, 3, 3)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________________ test_generic [(3, 5, 5) -> (3,) ] ____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s s1 = source(code) 195s print("source:", code) 195s 195s assert set(s1.flags) == flags 195s 195s assert ("fix" in flags) == s1.error 195s 195s for f in all_flags: 195s c3 = build( 195s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 195s ) 195s new_code = f"assert {c2}==snapshot({c3})" 195s 195s print(f"{set(f)}:") 195s print(" ", code) 195s print(" ", new_code) 195s > s2 = s1.run(*f) 195s 195s tests/test_preserve_values.py:245: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:137: in run 195s recorder.fix_all() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 195s file.rewrite() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 195s new_code = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s 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))' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_138.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3,)==snapshot((3, 5, 5)) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert (3,)==snapshot((3, 5, 5)) 195s source: assert (3,)==snapshot((3, 5, 5)) 195s set(): 195s assert (3,)==snapshot((3, 5, 5)) 195s assert (3,)==snapshot((3, 5, 5)) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3,)==snapshot((3, 5, 5)) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert (3,)==snapshot((3, 5, 5)) 195s {'fix'}: 195s assert (3,)==snapshot((3, 5, 5)) 195s assert (3,)==snapshot((3,)) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3,)==snapshot((3, 5, 5)) 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_136.py", line 9, in 195s assert (3,)==snapshot((3, 5, 5)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_137.py", line 9, in 195s assert (3,)==snapshot((3, 5, 5)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________________ test_generic [(3, 5) -> (3, 8) ] _____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_139.py:9: in 195s assert (3, 8)==snapshot((3, 5)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_139.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3, 8)==snapshot((3, 5)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [(3, 5, 2+2) -> (3, 4) ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_140.py:9: in 195s assert (3, 4)==snapshot((3, 5, 2+2)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_140.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3, 4)==snapshot((3, 5, 2+2)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ___________________ test_generic [(3, 5, 3) -> (3, 3) ] ___________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s s1 = source(code) 195s print("source:", code) 195s 195s assert set(s1.flags) == flags 195s 195s assert ("fix" in flags) == s1.error 195s 195s for f in all_flags: 195s c3 = build( 195s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 195s ) 195s new_code = f"assert {c2}==snapshot({c3})" 195s 195s print(f"{set(f)}:") 195s print(" ", code) 195s print(" ", new_code) 195s > s2 = s1.run(*f) 195s 195s tests/test_preserve_values.py:245: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:137: in run 195s recorder.fix_all() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 195s file.rewrite() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 195s new_code = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s 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))' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_143.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3, 3)==snapshot((3, 5, 3)) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert (3, 3)==snapshot((3, 5, 3)) 195s source: assert (3, 3)==snapshot((3, 5, 3)) 195s set(): 195s assert (3, 3)==snapshot((3, 5, 3)) 195s assert (3, 3)==snapshot((3, 5, 3)) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3, 3)==snapshot((3, 5, 3)) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert (3, 3)==snapshot((3, 5, 3)) 195s {'fix'}: 195s assert (3, 3)==snapshot((3, 5, 3)) 195s assert (3, 3)==snapshot((3, 3)) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3, 3)==snapshot((3, 5, 3)) 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_141.py", line 9, in 195s assert (3, 3)==snapshot((3, 5, 3)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_142.py", line 9, in 195s assert (3, 3)==snapshot((3, 5, 3)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________________ test_generic [(3, 5) -> (3, 8) ] _____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_144.py:9: in 195s assert (3, 8)==snapshot((3, 5)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_144.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3, 8)==snapshot((3, 5)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____________________ test_generic [(3,) -> (3, 8, 8) ] ____________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_145.py:9: in 195s assert (3, 8, 8)==snapshot((3,)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_145.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3, 8, 8)==snapshot((3,)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [(3, 2+2) -> (3, 8, 4) ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_146.py:9: in 195s assert (3, 8, 4)==snapshot((3, 2+2)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_146.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3, 8, 4)==snapshot((3, 2+2)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ___________________ test_generic [(3, 3) -> (3, 8, 3) ] ___________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_147.py:9: in 195s assert (3, 8, 3)==snapshot((3, 3)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_147.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3, 8, 3)==snapshot((3, 3)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [(3, 2+2, 5) -> (3, 4) ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_148.py:9: in 195s assert (3, 4)==snapshot((3, 2+2, 5)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_148.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3, 4)==snapshot((3, 2+2, 5)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [(3, 2+2) -> (3, 4, 8) ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_149.py:9: in 195s assert (3, 4, 8)==snapshot((3, 2+2)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_149.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3, 4, 8)==snapshot((3, 2+2)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [(3, 2+2, 2+2) -> (3, 4, 4) ] ______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_150.py:9: in 195s assert (3, 4, 4)==snapshot((3, 2+2, 2+2)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_150.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3, 4, 4)==snapshot((3, 2+2, 2+2)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [(3, 2+2, 3) -> (3, 4, 3) ] _______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_151.py:9: in 195s assert (3, 4, 3)==snapshot((3, 2+2, 3)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_151.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3, 4, 3)==snapshot((3, 2+2, 3)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ___________________ test_generic [(3, 3, 5) -> (3, 3) ] ___________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s s1 = source(code) 195s print("source:", code) 195s 195s assert set(s1.flags) == flags 195s 195s assert ("fix" in flags) == s1.error 195s 195s for f in all_flags: 195s c3 = build( 195s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 195s ) 195s new_code = f"assert {c2}==snapshot({c3})" 195s 195s print(f"{set(f)}:") 195s print(" ", code) 195s print(" ", new_code) 195s > s2 = s1.run(*f) 195s 195s tests/test_preserve_values.py:245: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:137: in run 195s recorder.fix_all() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 195s file.rewrite() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 195s new_code = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s 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))' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_154.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3, 3)==snapshot((3, 3, 5)) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert (3, 3)==snapshot((3, 3, 5)) 195s source: assert (3, 3)==snapshot((3, 3, 5)) 195s set(): 195s assert (3, 3)==snapshot((3, 3, 5)) 195s assert (3, 3)==snapshot((3, 3, 5)) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3, 3)==snapshot((3, 3, 5)) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert (3, 3)==snapshot((3, 3, 5)) 195s {'fix'}: 195s assert (3, 3)==snapshot((3, 3, 5)) 195s assert (3, 3)==snapshot((3, 3)) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3, 3)==snapshot((3, 3, 5)) 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_152.py", line 9, in 195s assert (3, 3)==snapshot((3, 3, 5)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_153.py", line 9, in 195s assert (3, 3)==snapshot((3, 3, 5)) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s ------------------------------ Captured log call ------------------------------- 195s 195s ___________________ test_generic [(3, 3) -> (3, 3, 8) ] ___________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_155.py:9: in 195s assert (3, 3, 8)==snapshot((3, 3)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 195s new_code = self.context.file._value_to_code(new_value_element) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '8 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_155.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3, 3, 8)==snapshot((3, 3)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _______________ test_generic [(3, 3, 2+2) -> (3, 3, 4) ] _______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_156.py:9: in 195s assert (3, 3, 4)==snapshot((3, 3, 2+2)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 195s v = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_156.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert (3, 3, 4)==snapshot((3, 3, 2+2)) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ________________ test_generic [{0: 5, 1: 5, 2: 5} -> {} ] _________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s s1 = source(code) 195s print("source:", code) 195s 195s assert set(s1.flags) == flags 195s 195s assert ("fix" in flags) == s1.error 195s 195s for f in all_flags: 195s c3 = build( 195s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 195s ) 195s new_code = f"assert {c2}==snapshot({c3})" 195s 195s print(f"{set(f)}:") 195s print(" ", code) 195s print(" ", new_code) 195s > s2 = s1.run(*f) 195s 195s tests/test_preserve_values.py:245: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:137: in run 195s recorder.fix_all() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 195s file.rewrite() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 195s new_code = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s 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})' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_161.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {}==snapshot({0: 5, 1: 5, 2: 5}) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert {}==snapshot({0: 5, 1: 5, 2: 5}) 195s source: assert {}==snapshot({0: 5, 1: 5, 2: 5}) 195s set(): 195s assert {}==snapshot({0: 5, 1: 5, 2: 5}) 195s assert {}==snapshot({0: 5, 1: 5, 2: 5}) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {}==snapshot({0: 5, 1: 5, 2: 5}) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert {}==snapshot({0: 5, 1: 5, 2: 5}) 195s {'fix'}: 195s assert {}==snapshot({0: 5, 1: 5, 2: 5}) 195s assert {}==snapshot({}) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {}==snapshot({0: 5, 1: 5, 2: 5}) 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_159.py", line 9, in 195s assert {}==snapshot({0: 5, 1: 5, 2: 5}) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_160.py", line 9, in 195s assert {}==snapshot({0: 5, 1: 5, 2: 5}) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s ------------------------------ Captured log call ------------------------------- 195s 195s _________________ test_generic [{0: 5, 1: 5} -> {2: 8} ] __________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_162.py:9: in 195s assert {2: 8}==snapshot({0: 5, 1: 5}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 195s self.context.file._value_to_code(k), 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '2 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_162.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {2: 8}==snapshot({0: 5, 1: 5}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _________ test_generic [{0: 5, 1: 5, 2: 2+2} -> {2: 4} ] __________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_163.py:9: in 195s assert {2: 4}==snapshot({0: 5, 1: 5, 2: 2+2}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_163.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {2: 4}==snapshot({0: 5, 1: 5, 2: 2+2}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [{0: 5, 1: 5, 2: 3} -> {2: 3} ] _______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s s1 = source(code) 195s print("source:", code) 195s 195s assert set(s1.flags) == flags 195s 195s assert ("fix" in flags) == s1.error 195s 195s for f in all_flags: 195s c3 = build( 195s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 195s ) 195s new_code = f"assert {c2}==snapshot({c3})" 195s 195s print(f"{set(f)}:") 195s print(" ", code) 195s print(" ", new_code) 195s > s2 = s1.run(*f) 195s 195s tests/test_preserve_values.py:245: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:137: in run 195s recorder.fix_all() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 195s file.rewrite() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 195s new_code = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s 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})' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_166.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 195s source: assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 195s set(): 195s assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 195s assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 195s {'fix'}: 195s assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 195s assert {2: 3}==snapshot({2: 3}) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_164.py", line 9, in 195s assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_165.py", line 9, in 195s assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s ------------------------------ Captured log call ------------------------------- 195s 195s _________________ test_generic [{0: 5, 2: 5} -> {1: 8} ] __________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_167.py:9: in 195s assert {1: 8}==snapshot({0: 5, 2: 5}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 195s self.context.file._value_to_code(k), 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '1 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_167.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {1: 8}==snapshot({0: 5, 2: 5}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _________________ test_generic [{0: 5} -> {1: 8, 2: 8} ] __________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_168.py:9: in 195s assert {1: 8, 2: 8}==snapshot({0: 5}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 195s self.context.file._value_to_code(k), 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '1 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_168.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {1: 8, 2: 8}==snapshot({0: 5}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _________ test_generic [{0: 5, 2: 2+2} -> {1: 8, 2: 4} ] __________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_169.py:9: in 195s assert {1: 8, 2: 4}==snapshot({0: 5, 2: 2+2}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_169.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {1: 8, 2: 4}==snapshot({0: 5, 2: 2+2}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [{0: 5, 2: 3} -> {1: 8, 2: 3} ] _______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_170.py:9: in 195s assert {1: 8, 2: 3}==snapshot({0: 5, 2: 3}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 195s self.context.file._value_to_code(k), 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '1 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_170.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {1: 8, 2: 3}==snapshot({0: 5, 2: 3}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _________ test_generic [{0: 5, 1: 2+2, 2: 5} -> {1: 4} ] __________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_171.py:9: in 195s assert {1: 4}==snapshot({0: 5, 1: 2+2, 2: 5}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_171.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {1: 4}==snapshot({0: 5, 1: 2+2, 2: 5}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _________ test_generic [{0: 5, 1: 2+2} -> {1: 4, 2: 8} ] __________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_172.py:9: in 195s assert {1: 4, 2: 8}==snapshot({0: 5, 1: 2+2}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_172.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {1: 4, 2: 8}==snapshot({0: 5, 1: 2+2}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____ test_generic [{0: 5, 1: 2+2, 2: 2+2} -> {1: 4, 2: 4} ] ______ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_173.py:9: in 195s assert {1: 4, 2: 4}==snapshot({0: 5, 1: 2+2, 2: 2+2}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_173.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {1: 4, 2: 4}==snapshot({0: 5, 1: 2+2, 2: 2+2}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______ test_generic [{0: 5, 1: 2+2, 2: 3} -> {1: 4, 2: 3} ] _______ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_174.py:9: in 195s assert {1: 4, 2: 3}==snapshot({0: 5, 1: 2+2, 2: 3}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_174.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {1: 4, 2: 3}==snapshot({0: 5, 1: 2+2, 2: 3}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [{0: 5, 1: 3, 2: 5} -> {1: 3} ] _______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s s1 = source(code) 195s print("source:", code) 195s 195s assert set(s1.flags) == flags 195s 195s assert ("fix" in flags) == s1.error 195s 195s for f in all_flags: 195s c3 = build( 195s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 195s ) 195s new_code = f"assert {c2}==snapshot({c3})" 195s 195s print(f"{set(f)}:") 195s print(" ", code) 195s print(" ", new_code) 195s > s2 = s1.run(*f) 195s 195s tests/test_preserve_values.py:245: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:137: in run 195s recorder.fix_all() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 195s file.rewrite() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 195s new_code = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s 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})' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_177.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 195s source: assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 195s set(): 195s assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 195s assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 195s {'fix'}: 195s assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 195s assert {1: 3}==snapshot({1: 3}) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_175.py", line 9, in 195s assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_176.py", line 9, in 195s assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [{0: 5, 1: 3} -> {1: 3, 2: 8} ] _______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_178.py:9: in 195s assert {1: 3, 2: 8}==snapshot({0: 5, 1: 3}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 195s self.context.file._value_to_code(k), 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '2 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_178.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {1: 3, 2: 8}==snapshot({0: 5, 1: 3}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______ test_generic [{0: 5, 1: 3, 2: 2+2} -> {1: 3, 2: 4} ] _______ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_179.py:9: in 195s assert {1: 3, 2: 4}==snapshot({0: 5, 1: 3, 2: 2+2}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_179.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {1: 3, 2: 4}==snapshot({0: 5, 1: 3, 2: 2+2}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ___________ test_generic [{0: 5, 1: 3, 2: 3} -> {1: 3, 2: 3} ] ____________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s s1 = source(code) 195s print("source:", code) 195s 195s assert set(s1.flags) == flags 195s 195s assert ("fix" in flags) == s1.error 195s 195s for f in all_flags: 195s c3 = build( 195s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 195s ) 195s new_code = f"assert {c2}==snapshot({c3})" 195s 195s print(f"{set(f)}:") 195s print(" ", code) 195s print(" ", new_code) 195s > s2 = s1.run(*f) 195s 195s tests/test_preserve_values.py:245: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:137: in run 195s recorder.fix_all() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 195s file.rewrite() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 195s new_code = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s 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})' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_182.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 195s source: assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 195s set(): 195s assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 195s assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 195s {'fix'}: 195s assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 195s assert {1: 3, 2: 3}==snapshot({1: 3, 2: 3}) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_180.py", line 9, in 195s assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_181.py", line 9, in 195s assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s ------------------------------ Captured log call ------------------------------- 195s 195s _________________ test_generic [{1: 5, 2: 5} -> {0: 8} ] __________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_183.py:9: in 195s assert {0: 8}==snapshot({1: 5, 2: 5}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 195s self.context.file._value_to_code(k), 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '0 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_183.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 8}==snapshot({1: 5, 2: 5}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _________________ test_generic [{1: 5} -> {0: 8, 2: 8} ] __________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_184.py:9: in 195s assert {0: 8, 2: 8}==snapshot({1: 5}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 195s self.context.file._value_to_code(k), 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '0 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_184.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 8, 2: 8}==snapshot({1: 5}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _________ test_generic [{1: 5, 2: 2+2} -> {0: 8, 2: 4} ] __________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_185.py:9: in 195s assert {0: 8, 2: 4}==snapshot({1: 5, 2: 2+2}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_185.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 8, 2: 4}==snapshot({1: 5, 2: 2+2}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [{1: 5, 2: 3} -> {0: 8, 2: 3} ] _______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_186.py:9: in 195s assert {0: 8, 2: 3}==snapshot({1: 5, 2: 3}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 195s self.context.file._value_to_code(k), 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '0 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_186.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 8, 2: 3}==snapshot({1: 5, 2: 3}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _________________ test_generic [{2: 5} -> {0: 8, 1: 8} ] __________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_187.py:9: in 195s assert {0: 8, 1: 8}==snapshot({2: 5}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 195s self.context.file._value_to_code(k), 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '0 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_187.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 8, 1: 8}==snapshot({2: 5}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ________________ test_generic [{} -> {0: 8, 1: 8, 2: 8} ] _________________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_188.py:9: in 195s assert {0: 8, 1: 8, 2: 8}==snapshot({}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 195s self.context.file._value_to_code(k), 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '0 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_188.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 8, 1: 8, 2: 8}==snapshot({}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _________ test_generic [{2: 2+2} -> {0: 8, 1: 8, 2: 4} ] __________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_189.py:9: in 195s assert {0: 8, 1: 8, 2: 4}==snapshot({2: 2+2}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_189.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 8, 1: 8, 2: 4}==snapshot({2: 2+2}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [{2: 3} -> {0: 8, 1: 8, 2: 3} ] _______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_190.py:9: in 195s assert {0: 8, 1: 8, 2: 3}==snapshot({2: 3}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 195s self.context.file._value_to_code(k), 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '0 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_190.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 8, 1: 8, 2: 3}==snapshot({2: 3}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _________ test_generic [{1: 2+2, 2: 5} -> {0: 8, 1: 4} ] __________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_191.py:9: in 195s assert {0: 8, 1: 4}==snapshot({1: 2+2, 2: 5}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_191.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 8, 1: 4}==snapshot({1: 2+2, 2: 5}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _________ test_generic [{1: 2+2} -> {0: 8, 1: 4, 2: 8} ] __________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_192.py:9: in 195s assert {0: 8, 1: 4, 2: 8}==snapshot({1: 2+2}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_192.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 8, 1: 4, 2: 8}==snapshot({1: 2+2}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____ test_generic [{1: 2+2, 2: 2+2} -> {0: 8, 1: 4, 2: 4} ] ______ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_193.py:9: in 195s assert {0: 8, 1: 4, 2: 4}==snapshot({1: 2+2, 2: 2+2}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_193.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 8, 1: 4, 2: 4}==snapshot({1: 2+2, 2: 2+2}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______ test_generic [{1: 2+2, 2: 3} -> {0: 8, 1: 4, 2: 3} ] _______ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_194.py:9: in 195s assert {0: 8, 1: 4, 2: 3}==snapshot({1: 2+2, 2: 3}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_194.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 8, 1: 4, 2: 3}==snapshot({1: 2+2, 2: 3}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [{1: 3, 2: 5} -> {0: 8, 1: 3} ] _______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_195.py:9: in 195s assert {0: 8, 1: 3}==snapshot({1: 3, 2: 5}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 195s self.context.file._value_to_code(k), 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '0 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_195.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 8, 1: 3}==snapshot({1: 3, 2: 5}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [{1: 3} -> {0: 8, 1: 3, 2: 8} ] _______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_196.py:9: in 195s assert {0: 8, 1: 3, 2: 8}==snapshot({1: 3}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 195s self.context.file._value_to_code(k), 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '0 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_196.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 8, 1: 3, 2: 8}==snapshot({1: 3}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______ test_generic [{1: 3, 2: 2+2} -> {0: 8, 1: 3, 2: 4} ] _______ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_197.py:9: in 195s assert {0: 8, 1: 3, 2: 4}==snapshot({1: 3, 2: 2+2}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 195s self.context.file._value_to_code(k), 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '0 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_197.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 8, 1: 3, 2: 4}==snapshot({1: 3, 2: 2+2}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ___________ test_generic [{1: 3, 2: 3} -> {0: 8, 1: 3, 2: 3} ] ____________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_198.py:9: in 195s assert {0: 8, 1: 3, 2: 3}==snapshot({1: 3, 2: 3}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 195s self.context.file._value_to_code(k), 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '0 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_198.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 8, 1: 3, 2: 3}==snapshot({1: 3, 2: 3}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _________ test_generic [{0: 2+2, 1: 5, 2: 5} -> {0: 4} ] __________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_199.py:9: in 195s assert {0: 4}==snapshot({0: 2+2, 1: 5, 2: 5}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_199.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 4}==snapshot({0: 2+2, 1: 5, 2: 5}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _________ test_generic [{0: 2+2, 1: 5} -> {0: 4, 2: 8} ] __________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_200.py:9: in 195s assert {0: 4, 2: 8}==snapshot({0: 2+2, 1: 5}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_200.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 4, 2: 8}==snapshot({0: 2+2, 1: 5}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____ test_generic [{0: 2+2, 1: 5, 2: 2+2} -> {0: 4, 2: 4} ] ______ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_201.py:9: in 195s assert {0: 4, 2: 4}==snapshot({0: 2+2, 1: 5, 2: 2+2}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_201.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 4, 2: 4}==snapshot({0: 2+2, 1: 5, 2: 2+2}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______ test_generic [{0: 2+2, 1: 5, 2: 3} -> {0: 4, 2: 3} ] _______ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_202.py:9: in 195s assert {0: 4, 2: 3}==snapshot({0: 2+2, 1: 5, 2: 3}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_202.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 4, 2: 3}==snapshot({0: 2+2, 1: 5, 2: 3}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _________ test_generic [{0: 2+2, 2: 5} -> {0: 4, 1: 8} ] __________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_203.py:9: in 195s assert {0: 4, 1: 8}==snapshot({0: 2+2, 2: 5}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_203.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 4, 1: 8}==snapshot({0: 2+2, 2: 5}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _________ test_generic [{0: 2+2} -> {0: 4, 1: 8, 2: 8} ] __________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_204.py:9: in 195s assert {0: 4, 1: 8, 2: 8}==snapshot({0: 2+2}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_204.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 4, 1: 8, 2: 8}==snapshot({0: 2+2}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____ test_generic [{0: 2+2, 2: 2+2} -> {0: 4, 1: 8, 2: 4} ] ______ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_205.py:9: in 195s assert {0: 4, 1: 8, 2: 4}==snapshot({0: 2+2, 2: 2+2}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_205.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 4, 1: 8, 2: 4}==snapshot({0: 2+2, 2: 2+2}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______ test_generic [{0: 2+2, 2: 3} -> {0: 4, 1: 8, 2: 3} ] _______ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_206.py:9: in 195s assert {0: 4, 1: 8, 2: 3}==snapshot({0: 2+2, 2: 3}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_206.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 4, 1: 8, 2: 3}==snapshot({0: 2+2, 2: 3}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____ test_generic [{0: 2+2, 1: 2+2, 2: 5} -> {0: 4, 1: 4} ] ______ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_207.py:9: in 195s assert {0: 4, 1: 4}==snapshot({0: 2+2, 1: 2+2, 2: 5}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_207.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 4, 1: 4}==snapshot({0: 2+2, 1: 2+2, 2: 5}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____ test_generic [{0: 2+2, 1: 2+2} -> {0: 4, 1: 4, 2: 8} ] ______ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_208.py:9: in 195s assert {0: 4, 1: 4, 2: 8}==snapshot({0: 2+2, 1: 2+2}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_208.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 4, 1: 4, 2: 8}==snapshot({0: 2+2, 1: 2+2}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ____ test_generic [{0: 2+2, 1: 2+2, 2: 2+2} -> {0: 4, 1: 4, 2: 4} ] ____ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_209.py:9: in 195s assert {0: 4, 1: 4, 2: 4}==snapshot({0: 2+2, 1: 2+2, 2: 2+2}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_209.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 4, 1: 4, 2: 4}==snapshot({0: 2+2, 1: 2+2, 2: 2+2}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____ test_generic [{0: 2+2, 1: 2+2, 2: 3} -> {0: 4, 1: 4, 2: 3} ] _____ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_210.py:9: in 195s assert {0: 4, 1: 4, 2: 3}==snapshot({0: 2+2, 1: 2+2, 2: 3}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_210.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 4, 1: 4, 2: 3}==snapshot({0: 2+2, 1: 2+2, 2: 3}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______ test_generic [{0: 2+2, 1: 3, 2: 5} -> {0: 4, 1: 3} ] _______ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_211.py:9: in 195s assert {0: 4, 1: 3}==snapshot({0: 2+2, 1: 3, 2: 5}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_211.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 4, 1: 3}==snapshot({0: 2+2, 1: 3, 2: 5}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______ test_generic [{0: 2+2, 1: 3} -> {0: 4, 1: 3, 2: 8} ] _______ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_212.py:9: in 195s assert {0: 4, 1: 3, 2: 8}==snapshot({0: 2+2, 1: 3}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_212.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 4, 1: 3, 2: 8}==snapshot({0: 2+2, 1: 3}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____ test_generic [{0: 2+2, 1: 3, 2: 2+2} -> {0: 4, 1: 3, 2: 4} ] _____ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_213.py:9: in 195s assert {0: 4, 1: 3, 2: 4}==snapshot({0: 2+2, 1: 3, 2: 2+2}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_213.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 4, 1: 3, 2: 4}==snapshot({0: 2+2, 1: 3, 2: 2+2}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______ test_generic [{0: 2+2, 1: 3, 2: 3} -> {0: 4, 1: 3, 2: 3} ] ______ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_214.py:9: in 195s assert {0: 4, 1: 3, 2: 3}==snapshot({0: 2+2, 1: 3, 2: 3}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_214.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 4, 1: 3, 2: 3}==snapshot({0: 2+2, 1: 3, 2: 3}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [{0: 3, 1: 5, 2: 5} -> {0: 3} ] _______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s s1 = source(code) 195s print("source:", code) 195s 195s assert set(s1.flags) == flags 195s 195s assert ("fix" in flags) == s1.error 195s 195s for f in all_flags: 195s c3 = build( 195s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 195s ) 195s new_code = f"assert {c2}==snapshot({c3})" 195s 195s print(f"{set(f)}:") 195s print(" ", code) 195s print(" ", new_code) 195s > s2 = s1.run(*f) 195s 195s tests/test_preserve_values.py:245: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:137: in run 195s recorder.fix_all() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 195s file.rewrite() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 195s new_code = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s 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})' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_217.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 195s source: assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 195s set(): 195s assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 195s assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 195s {'fix'}: 195s assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 195s assert {0: 3}==snapshot({0: 3}) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_215.py", line 9, in 195s assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_216.py", line 9, in 195s assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [{0: 3, 1: 5} -> {0: 3, 2: 8} ] _______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_218.py:9: in 195s assert {0: 3, 2: 8}==snapshot({0: 3, 1: 5}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 195s self.context.file._value_to_code(k), 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '2 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_218.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 3, 2: 8}==snapshot({0: 3, 1: 5}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______ test_generic [{0: 3, 1: 5, 2: 2+2} -> {0: 3, 2: 4} ] _______ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_219.py:9: in 195s assert {0: 3, 2: 4}==snapshot({0: 3, 1: 5, 2: 2+2}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_219.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 3, 2: 4}==snapshot({0: 3, 1: 5, 2: 2+2}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ___________ test_generic [{0: 3, 1: 5, 2: 3} -> {0: 3, 2: 3} ] ____________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s s1 = source(code) 195s print("source:", code) 195s 195s assert set(s1.flags) == flags 195s 195s assert ("fix" in flags) == s1.error 195s 195s for f in all_flags: 195s c3 = build( 195s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 195s ) 195s new_code = f"assert {c2}==snapshot({c3})" 195s 195s print(f"{set(f)}:") 195s print(" ", code) 195s print(" ", new_code) 195s > s2 = s1.run(*f) 195s 195s tests/test_preserve_values.py:245: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:137: in run 195s recorder.fix_all() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 195s file.rewrite() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 195s new_code = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s 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})' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_222.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 195s source: assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 195s set(): 195s assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 195s assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 195s {'fix'}: 195s assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 195s assert {0: 3, 2: 3}==snapshot({0: 3, 2: 3}) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_220.py", line 9, in 195s assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_221.py", line 9, in 195s assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [{0: 3, 2: 5} -> {0: 3, 1: 8} ] _______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_223.py:9: in 195s assert {0: 3, 1: 8}==snapshot({0: 3, 2: 5}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 195s self.context.file._value_to_code(k), 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '1 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_223.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 3, 1: 8}==snapshot({0: 3, 2: 5}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______________ test_generic [{0: 3} -> {0: 3, 1: 8, 2: 8} ] _______________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_224.py:9: in 195s assert {0: 3, 1: 8, 2: 8}==snapshot({0: 3}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 195s self.context.file._value_to_code(k), 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '1 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_224.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 3, 1: 8, 2: 8}==snapshot({0: 3}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______ test_generic [{0: 3, 2: 2+2} -> {0: 3, 1: 8, 2: 4} ] _______ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_225.py:9: in 195s assert {0: 3, 1: 8, 2: 4}==snapshot({0: 3, 2: 2+2}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_225.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 3, 1: 8, 2: 4}==snapshot({0: 3, 2: 2+2}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ___________ test_generic [{0: 3, 2: 3} -> {0: 3, 1: 8, 2: 3} ] ____________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_226.py:9: in 195s assert {0: 3, 1: 8, 2: 3}==snapshot({0: 3, 2: 3}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 195s self.context.file._value_to_code(k), 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '1 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_226.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 3, 1: 8, 2: 3}==snapshot({0: 3, 2: 3}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______ test_generic [{0: 3, 1: 2+2, 2: 5} -> {0: 3, 1: 4} ] _______ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_227.py:9: in 195s assert {0: 3, 1: 4}==snapshot({0: 3, 1: 2+2, 2: 5}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_227.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 3, 1: 4}==snapshot({0: 3, 1: 2+2, 2: 5}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______ test_generic [{0: 3, 1: 2+2} -> {0: 3, 1: 4, 2: 8} ] _______ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_228.py:9: in 195s assert {0: 3, 1: 4, 2: 8}==snapshot({0: 3, 1: 2+2}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_228.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 3, 1: 4, 2: 8}==snapshot({0: 3, 1: 2+2}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s _____ test_generic [{0: 3, 1: 2+2, 2: 2+2} -> {0: 3, 1: 4, 2: 4} ] _____ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_229.py:9: in 195s assert {0: 3, 1: 4, 2: 4}==snapshot({0: 3, 1: 2+2, 2: 2+2}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_229.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 3, 1: 4, 2: 4}==snapshot({0: 3, 1: 2+2, 2: 2+2}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______ test_generic [{0: 3, 1: 2+2, 2: 3} -> {0: 3, 1: 4, 2: 3} ] ______ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_230.py:9: in 195s assert {0: 3, 1: 4, 2: 3}==snapshot({0: 3, 1: 2+2, 2: 3}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_230.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 3, 1: 4, 2: 3}==snapshot({0: 3, 1: 2+2, 2: 3}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ___________ test_generic [{0: 3, 1: 3, 2: 5} -> {0: 3, 1: 3} ] ____________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s s1 = source(code) 195s print("source:", code) 195s 195s assert set(s1.flags) == flags 195s 195s assert ("fix" in flags) == s1.error 195s 195s for f in all_flags: 195s c3 = build( 195s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 195s ) 195s new_code = f"assert {c2}==snapshot({c3})" 195s 195s print(f"{set(f)}:") 195s print(" ", code) 195s print(" ", new_code) 195s > s2 = s1.run(*f) 195s 195s tests/test_preserve_values.py:245: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:137: in run 195s recorder.fix_all() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 195s file.rewrite() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 195s new_code = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s 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})' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_233.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 195s source: assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 195s set(): 195s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 195s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 195s reported_flags: {'fix'} 195s run: pytest --inline-snapshot= 195s output: 195s |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 195s {'fix'}: 195s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 195s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3}) 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_231.py", line 9, in 195s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s Traceback (most recent call last): 195s File "/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py", line 114, in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_232.py", line 9, in 195s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s AssertionError 195s ------------------------------ Captured log call ------------------------------- 195s 195s ___________ test_generic [{0: 3, 1: 3} -> {0: 3, 1: 3, 2: 8} ] ____________ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_234.py:9: in 195s assert {0: 3, 1: 3, 2: 8}==snapshot({0: 3, 1: 3}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 195s self.context.file._value_to_code(k), 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 195s return self._token_to_code(value_to_token(value)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '2 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_234.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 3, 1: 3, 2: 8}==snapshot({0: 3, 1: 3}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ______ test_generic [{0: 3, 1: 3, 2: 2+2} -> {0: 3, 1: 3, 2: 4} ] ______ 195s 195s source = .w at 0x748e1992bb00> 195s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x748e1d0bbb90>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 195s 195s def test_generic(source, subtests): 195s for braces in ("[]", "()", "{}"): 195s for value_specs in itertools.product(stuff, repeat=3): 195s flags = set().union(*[e[3] for e in value_specs]) 195s all_flags = { 195s frozenset(x) - {""} 195s for x in itertools.combinations_with_replacement( 195s flags | {""}, len(flags) 195s ) 195s } 195s 195s def build(value_lists): 195s value_lists = list(value_lists) 195s 195s if braces == "{}": 195s values = [ 195s f"{i}: {value_list[0]}" 195s for i, value_list in enumerate(value_lists) 195s if value_list 195s ] 195s else: 195s values = [x for value_list in value_lists for x in value_list] 195s 195s code = ", ".join(values) 195s 195s comma = "" 195s if len(values) == 1 and braces == "()": 195s comma = "," 195s 195s return f"{braces[0]}{code}{comma}{braces[1]}" 195s 195s c1 = build(spec[0] for spec in value_specs) 195s c2 = build(spec[1] for spec in value_specs) 195s code = f"assert {c2}==snapshot({c1})" 195s 195s named_flags = ", ".join(flags) 195s 195s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 195s > s1 = source(code) 195s 195s tests/test_preserve_values.py:229: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_235.py:9: in 195s assert {0: 3, 1: 3, 2: 4}==snapshot({0: 3, 1: 3, 2: 2+2}) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 195s result[key] = yield from self.get_adapter( 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_235.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert {0: 3, 1: 3, 2: 4}==snapshot({0: 3, 1: 3, 2: 2+2}) 195s ------------------------------ Captured log call ------------------------------- 195s 195s ________________________ test_pydantic_create_snapshot _________________________ 195s 195s def test_pydantic_create_snapshot(): 195s 195s Example( 195s """ 195s from pydantic import BaseModel 195s from inline_snapshot import snapshot 195s 195s class M(BaseModel): 195s size:int 195s name:str 195s age:int=4 195s 195s def test_pydantic(): 195s m=M(size=5,name="Tom") 195s assert m==snapshot() 195s assert m.dict()==snapshot() 195s 195s """ 195s > ).run_pytest( 195s ["--inline-snapshot=create"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s 195s from pydantic import BaseModel 195s from inline_snapshot import snapshot 195s 195s class M(BaseModel): 195s size:int 195s name:str 195s age:int=4 195s 195s def test_pydantic(): 195s m=M(size=5,name="Tom") 195s assert m==snapshot(M(size=5, name="Tom")) 195s assert m.dict()==snapshot({"size": 5, "name": "Tom", "age": 4}) 195s 195s \ 195s """ 195s } 195s ), 195s ).run_pytest( 195s ["--inline-snapshot=disable"] 195s ) 195s 195s tests/test_pydantic.py:23: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = ['--inline-snapshot=create'] 195s 195s def run_pytest( 195s self, 195s args: list[str] = [], 195s *, 195s term_columns=80, 195s env: dict[str, str] = {}, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s stderr: Snapshot[str] | None = None, 195s returncode: Snapshot[int] | None = None, 195s ) -> Example: 195s """Run pytest with the given args and env variables in an seperate 195s process. 195s 195s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 195s 195s Parameters: 195s args: pytest arguments like "--inline-snapshot=fix" 195s env: dict of environment variables 195s changed_files: snapshot of files which are changed by this run. 195s report: snapshot of the report at the end of the pytest run. 195s stderr: pytest stderr output 195s returncode: snapshot of the pytest returncode. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s self._write_files(tmp_path) 195s 195s cmd = [sys.executable, "-m", "pytest", *args] 195s 195s command_env = dict(os.environ) 195s command_env["TERM"] = "unknown" 195s command_env["COLUMNS"] = str( 195s term_columns + 1 if platform.system() == "Windows" else term_columns 195s ) 195s command_env.pop("CI", None) 195s 195s command_env.update(env) 195s 195s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 195s 195s print("run>", *cmd) 195s print("stdout:") 195s print(result.stdout.decode()) 195s print("stderr:") 195s print(result.stderr.decode()) 195s 195s if returncode is not None: 195s assert result.returncode == returncode 195s 195s if stderr is not None: 195s assert result.stderr.decode() == stderr 195s 195s if report is not None: 195s 195s report_list = [] 195s record = False 195s for line in result.stdout.decode().splitlines(): 195s line = line.strip() 195s if line.startswith("===="): 195s record = False 195s 195s if record and line: 195s report_list.append(line) 195s 195s if line.startswith("====") and "inline snapshot" in line: 195s record = True 195s 195s report_str = "\n".join(report_list) 195s 195s assert normalize(report_str) == report, repr(report_str) 195s 195s if changed_files is not None: 195s current_files = {} 195s 195s for name, content in sorted(self._read_files(tmp_path).items()): 195s if name not in self.files or self.files[name] != content: 195s current_files[name] = content 195s > assert changed_files == current_files 195s E AssertionError: assert {'test_someth... 4})\n\n '} == {} 195s E 195s E Left contains 1 more item: 195s E {'test_something.py': '\n' 195s E 'from pydantic import BaseModel\n' 195s E 'from inline_snapshot import snapshot\n' 195s E '\n' 195s E 'class M(BaseModel):\n'... 195s E 195s E ...Full output truncated (12 lines hidden), use '-vv' to show 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s 195s from pydantic import BaseModel 195s from inline_snapshot import snapshot 195s 195s class M(BaseModel): 195s size:int 195s name:str 195s age:int=4 195s 195s def test_pydantic(): 195s m=M(size=5,name="Tom") 195s assert m==snapshot() 195s assert m.dict()==snapshot() 195s 195s 195s 195s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmp4g0tu4rb 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_something.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ________________________________ test_pydantic _________________________________ 195s 195s def test_pydantic(): 195s m=M(size=5,name="Tom") 195s > assert m==snapshot() 195s 195s test_something.py:12: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '', filename = PosixPath('/tmp/tmp4g0tu4rb/test_something.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_something.py::test_pydantic - TypeError: CliRunner.__init__() got... 195s ============================== 1 failed in 0.27s =============================== 195s 195s stderr: 195s 195s ___________________________ test_pydantic_field_repr ___________________________ 195s 195s def test_pydantic_field_repr(): 195s 195s Example( 195s """\ 195s from inline_snapshot import snapshot 195s from pydantic import BaseModel,Field 195s 195s class container(BaseModel): 195s a: int 195s b: int = Field(default=5,repr=False) 195s 195s assert container(a=1,b=5) == snapshot() 195s """ 195s > ).run_pytest( 195s ["--inline-snapshot=create"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s from inline_snapshot import snapshot 195s from pydantic import BaseModel,Field 195s 195s class container(BaseModel): 195s a: int 195s b: int = Field(default=5,repr=False) 195s 195s assert container(a=1,b=5) == snapshot(container(a=1)) 195s """ 195s } 195s ), 195s ).run_pytest( 195s ["--inline-snapshot=disable"] 195s ) 195s 195s tests/test_pydantic.py:64: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = ['--inline-snapshot=create'] 195s 195s def run_pytest( 195s self, 195s args: list[str] = [], 195s *, 195s term_columns=80, 195s env: dict[str, str] = {}, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s stderr: Snapshot[str] | None = None, 195s returncode: Snapshot[int] | None = None, 195s ) -> Example: 195s """Run pytest with the given args and env variables in an seperate 195s process. 195s 195s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 195s 195s Parameters: 195s args: pytest arguments like "--inline-snapshot=fix" 195s env: dict of environment variables 195s changed_files: snapshot of files which are changed by this run. 195s report: snapshot of the report at the end of the pytest run. 195s stderr: pytest stderr output 195s returncode: snapshot of the pytest returncode. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s self._write_files(tmp_path) 195s 195s cmd = [sys.executable, "-m", "pytest", *args] 195s 195s command_env = dict(os.environ) 195s command_env["TERM"] = "unknown" 195s command_env["COLUMNS"] = str( 195s term_columns + 1 if platform.system() == "Windows" else term_columns 195s ) 195s command_env.pop("CI", None) 195s 195s command_env.update(env) 195s 195s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 195s 195s print("run>", *cmd) 195s print("stdout:") 195s print(result.stdout.decode()) 195s print("stderr:") 195s print(result.stderr.decode()) 195s 195s if returncode is not None: 195s assert result.returncode == returncode 195s 195s if stderr is not None: 195s assert result.stderr.decode() == stderr 195s 195s if report is not None: 195s 195s report_list = [] 195s record = False 195s for line in result.stdout.decode().splitlines(): 195s line = line.strip() 195s if line.startswith("===="): 195s record = False 195s 195s if record and line: 195s report_list.append(line) 195s 195s if line.startswith("====") and "inline snapshot" in line: 195s record = True 195s 195s report_str = "\n".join(report_list) 195s 195s assert normalize(report_str) == report, repr(report_str) 195s 195s if changed_files is not None: 195s current_files = {} 195s 195s for name, content in sorted(self._read_files(tmp_path).items()): 195s if name not in self.files or self.files[name] != content: 195s current_files[name] = content 195s > assert changed_files == current_files 195s E AssertionError: assert {'test_someth...iner(a=1))\n'} == {} 195s E 195s E Left contains 1 more item: 195s E {'test_something.py': 'from inline_snapshot import snapshot\n' 195s E 'from pydantic import BaseModel,Field\n' 195s E '\n' 195s E 'class container(BaseModel):\n' 195s E ' a: int\n'... 195s E 195s E ...Full output truncated (4 lines hidden), use '-vv' to show 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot 195s from pydantic import BaseModel,Field 195s 195s class container(BaseModel): 195s a: int 195s b: int = Field(default=5,repr=False) 195s 195s assert container(a=1,b=5) == snapshot() 195s 195s 195s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmp41eyxcos 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 0 items / 1 error 195s 195s ==================================== ERRORS ==================================== 195s ______________________ ERROR collecting test_something.py ______________________ 195s test_something.py:8: in 195s assert container(a=1,b=5) == snapshot() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 195s runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s ERROR test_something.py - TypeError: CliRunner.__init__() got an unexpected k... 195s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 195s =============================== 1 error in 0.33s =============================== 195s 195s stderr: 195s 195s _________________________ test_pydantic_default_value __________________________ 195s 195s def test_pydantic_default_value(): 195s Example( 195s """\ 195s from inline_snapshot import snapshot,Is 195s from dataclasses import dataclass,field 195s from pydantic import BaseModel,Field 195s 195s class A(BaseModel): 195s a:int 195s b:int=2 195s c:list=Field(default_factory=list) 195s 195s def test_something(): 195s assert A(a=1) == snapshot(A(a=1,b=2,c=[])) 195s """ 195s > ).run_pytest( 195s ["--inline-snapshot=update"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s from inline_snapshot import snapshot,Is 195s from dataclasses import dataclass,field 195s from pydantic import BaseModel,Field 195s 195s class A(BaseModel): 195s a:int 195s b:int=2 195s c:list=Field(default_factory=list) 195s 195s def test_something(): 195s assert A(a=1) == snapshot(A(a=1)) 195s """ 195s } 195s ), 195s ) 195s 195s tests/test_pydantic.py:100: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = ['--inline-snapshot=update'] 195s 195s def run_pytest( 195s self, 195s args: list[str] = [], 195s *, 195s term_columns=80, 195s env: dict[str, str] = {}, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s stderr: Snapshot[str] | None = None, 195s returncode: Snapshot[int] | None = None, 195s ) -> Example: 195s """Run pytest with the given args and env variables in an seperate 195s process. 195s 195s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 195s 195s Parameters: 195s args: pytest arguments like "--inline-snapshot=fix" 195s env: dict of environment variables 195s changed_files: snapshot of files which are changed by this run. 195s report: snapshot of the report at the end of the pytest run. 195s stderr: pytest stderr output 195s returncode: snapshot of the pytest returncode. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s self._write_files(tmp_path) 195s 195s cmd = [sys.executable, "-m", "pytest", *args] 195s 195s command_env = dict(os.environ) 195s command_env["TERM"] = "unknown" 195s command_env["COLUMNS"] = str( 195s term_columns + 1 if platform.system() == "Windows" else term_columns 195s ) 195s command_env.pop("CI", None) 195s 195s command_env.update(env) 195s 195s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 195s 195s print("run>", *cmd) 195s print("stdout:") 195s print(result.stdout.decode()) 195s print("stderr:") 195s print(result.stderr.decode()) 195s 195s if returncode is not None: 195s assert result.returncode == returncode 195s 195s if stderr is not None: 195s assert result.stderr.decode() == stderr 195s 195s if report is not None: 195s 195s report_list = [] 195s record = False 195s for line in result.stdout.decode().splitlines(): 195s line = line.strip() 195s if line.startswith("===="): 195s record = False 195s 195s if record and line: 195s report_list.append(line) 195s 195s if line.startswith("====") and "inline snapshot" in line: 195s record = True 195s 195s report_str = "\n".join(report_list) 195s 195s assert normalize(report_str) == report, repr(report_str) 195s 195s if changed_files is not None: 195s current_files = {} 195s 195s for name, content in sorted(self._read_files(tmp_path).items()): 195s if name not in self.files or self.files[name] != content: 195s current_files[name] = content 195s > assert changed_files == current_files 195s E AssertionError: assert {'test_someth...ot(A(a=1))\n'} == {} 195s E 195s E Left contains 1 more item: 195s E {'test_something.py': 'from inline_snapshot import snapshot,Is\n' 195s E 'from dataclasses import dataclass,field\n' 195s E 'from pydantic import BaseModel,Field\n' 195s E '\n' 195s E 'class A(BaseModel):\n'... 195s E 195s E ...Full output truncated (7 lines hidden), use '-vv' to show 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot,Is 195s from dataclasses import dataclass,field 195s from pydantic import BaseModel,Field 195s 195s class A(BaseModel): 195s a:int 195s b:int=2 195s c:list=Field(default_factory=list) 195s 195s def test_something(): 195s assert A(a=1) == snapshot(A(a=1,b=2,c=[])) 195s 195s 195s run> /usr/bin/python3.12 -m pytest --inline-snapshot=update 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmpi_bts43r 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_something.py . [100%] 195s =============================== inline snapshot ================================ 195s ─────────────────────────────── Update snapshots ─────────────────────────────── 195s 195s stderr: 195s Traceback (most recent call last): 195s File "", line 198, in _run_module_as_main 195s File "", line 88, in _run_code 195s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 195s raise SystemExit(pytest.console_main()) 195s ^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 195s code = main() 195s ^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 195s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 195s return wrap_session(config, _main) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 195s config.hook.pytest_sessionfinish( 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 195s teardown.send(result) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 195s self.config.hook.pytest_terminal_summary( 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary 195s diff = file.diff() 195s ^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff 195s unified_diff(self.source.splitlines(), self.new_code().splitlines()), 195s ^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s ^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s _________________________ test_pydantic_factory_method _________________________ 195s 195s def test_pydantic_factory_method(): 195s Example( 195s """\ 195s from inline_snapshot import snapshot 195s from pydantic import BaseModel 195s 195s class A(BaseModel): 195s a:int 195s 195s @classmethod 195s def from_str(cls,s): 195s return cls(a=int(s)) 195s 195s def test_something(): 195s for a in [1,2]: 195s assert A(a=2) == snapshot(A.from_str("1")) 195s """ 195s > ).run_pytest( 195s ["--inline-snapshot=fix"], 195s changed_files=snapshot( 195s { 195s "test_something.py": """\ 195s from inline_snapshot import snapshot 195s from pydantic import BaseModel 195s 195s class A(BaseModel): 195s a:int 195s 195s @classmethod 195s def from_str(cls,s): 195s return cls(a=int(s)) 195s 195s def test_something(): 195s for a in [1,2]: 195s assert A(a=2) == snapshot(A(a=2)) 195s """ 195s } 195s ), 195s ) 195s 195s tests/test_pydantic.py:157: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = ['--inline-snapshot=fix'] 195s 195s def run_pytest( 195s self, 195s args: list[str] = [], 195s *, 195s term_columns=80, 195s env: dict[str, str] = {}, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s stderr: Snapshot[str] | None = None, 195s returncode: Snapshot[int] | None = None, 195s ) -> Example: 195s """Run pytest with the given args and env variables in an seperate 195s process. 195s 195s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 195s 195s Parameters: 195s args: pytest arguments like "--inline-snapshot=fix" 195s env: dict of environment variables 195s changed_files: snapshot of files which are changed by this run. 195s report: snapshot of the report at the end of the pytest run. 195s stderr: pytest stderr output 195s returncode: snapshot of the pytest returncode. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s self._write_files(tmp_path) 195s 195s cmd = [sys.executable, "-m", "pytest", *args] 195s 195s command_env = dict(os.environ) 195s command_env["TERM"] = "unknown" 195s command_env["COLUMNS"] = str( 195s term_columns + 1 if platform.system() == "Windows" else term_columns 195s ) 195s command_env.pop("CI", None) 195s 195s command_env.update(env) 195s 195s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 195s 195s print("run>", *cmd) 195s print("stdout:") 195s print(result.stdout.decode()) 195s print("stderr:") 195s print(result.stderr.decode()) 195s 195s if returncode is not None: 195s assert result.returncode == returncode 195s 195s if stderr is not None: 195s assert result.stderr.decode() == stderr 195s 195s if report is not None: 195s 195s report_list = [] 195s record = False 195s for line in result.stdout.decode().splitlines(): 195s line = line.strip() 195s if line.startswith("===="): 195s record = False 195s 195s if record and line: 195s report_list.append(line) 195s 195s if line.startswith("====") and "inline snapshot" in line: 195s record = True 195s 195s report_str = "\n".join(report_list) 195s 195s assert normalize(report_str) == report, repr(report_str) 195s 195s if changed_files is not None: 195s current_files = {} 195s 195s for name, content in sorted(self._read_files(tmp_path).items()): 195s if name not in self.files or self.files[name] != content: 195s current_files[name] = content 195s > assert changed_files == current_files 195s E AssertionError: assert {'test_someth...ot(A(a=2))\n'} == {} 195s E 195s E Left contains 1 more item: 195s E {'test_something.py': 'from inline_snapshot import snapshot\n' 195s E 'from pydantic import BaseModel\n' 195s E '\n' 195s E 'class A(BaseModel):\n' 195s E ' a:int\n'... 195s E 195s E ...Full output truncated (9 lines hidden), use '-vv' to show 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot 195s from pydantic import BaseModel 195s 195s class A(BaseModel): 195s a:int 195s 195s @classmethod 195s def from_str(cls,s): 195s return cls(a=int(s)) 195s 195s def test_something(): 195s for a in [1,2]: 195s assert A(a=2) == snapshot(A.from_str("1")) 195s 195s 195s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmp9oadt1fw 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_something.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ________________________________ test_something ________________________________ 195s 195s def test_something(): 195s for a in [1,2]: 195s > assert A(a=2) == snapshot(A.from_str("1")) 195s 195s test_something.py:13: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:107: in assign 195s result = yield from self.value_assign(old_value, old_node, new_value) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py:87: in value_assign 195s result = yield from adapter.assign(old_value, old_node, new_value) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = 'A (a =2 )', filename = PosixPath('/tmp/tmp9oadt1fw/test_something.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_something.py::test_something - TypeError: CliRunner.__init__() go... 195s ============================== 1 failed in 0.26s =============================== 195s 195s stderr: 195s 195s __________________________________ test_pypy ___________________________________ 195s 195s @pytest.mark.no_rewriting 195s def test_pypy(): 195s report = ( 195s snapshot("INFO: inline-snapshot was disabled because pypy is not supported") 195s if sys.implementation.name == "pypy" 195s else snapshot( 195s """\ 195s -------------------------------- Fix snapshots --------------------------------- 195s +----------------------------- test_something.py ------------------------------+ 195s | @@ -1,6 +1,6 @@ | 195s | | 195s | from inline_snapshot import snapshot | 195s | | 195s | def test_example(): | 195s | - assert 1+1==snapshot(3) | 195s | + assert 1+1==snapshot(2) | 195s +------------------------------------------------------------------------------+ 195s These changes will be applied, because you used --inline-snapshot=fix\ 195s """ 195s ) 195s ) 195s 195s Example( 195s """\ 195s from inline_snapshot import snapshot 195s 195s def test_example(): 195s assert 1+1==snapshot(3) 195s 195s """ 195s > ).run_pytest(["--inline-snapshot=fix"], report=report).run_pytest( 195s ["--inline-snapshot=disable"], report="" 195s ) 195s 195s tests/test_pypy.py:38: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:319: in run_pytest 195s assert normalize(report_str) == report, repr(report_str) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = "''" 195s filename = PosixPath('/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_pypy.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_something.py 195s from inline_snapshot import snapshot 195s 195s def test_example(): 195s assert 1+1==snapshot(3) 195s 195s 195s 195s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmp6x69gen7 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_something.py F [100%] 195s 195s =================================== FAILURES =================================== 195s _________________________________ test_example _________________________________ 195s 195s def test_example(): 195s > assert 1+1==snapshot(3) 195s 195s test_something.py:4: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '2 ', filename = PosixPath('/tmp/tmp6x69gen7/test_something.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_something.py::test_example - TypeError: CliRunner.__init__() got ... 195s ============================== 1 failed in 0.19s =============================== 195s 195s stderr: 195s 195s _________________________________ test_create __________________________________ 195s 195s project = .Project object at 0x748e18c9cfe0> 195s 195s def test_create(project): 195s project.setup( 195s """\ 195s def test_a(): 195s assert 5==snapshot() 195s """ 195s ) 195s 195s result = project.run() 195s 195s > result.assert_outcomes(errors=1, passed=1) 195s E AssertionError: assert {'errors': 1,...pped': 0, ...} == {'errors': 1,...pped': 0, ...} 195s E 195s E Omitting 4 identical items, use -vv to show 195s E Differing items: 195s E {'passed': 0} != {'passed': 1} 195s E {'failed': 1} != {'failed': 0} 195s E Use -v to get more diff 195s 195s /tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_pytest_plugin.py:24: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s write code: 195s # äöß 🐍 195s from inline_snapshot import snapshot 195s from inline_snapshot import outsource 195s 195s 195s def test_a(): 195s assert 5==snapshot() 195s 195s running: pytest 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_create0 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_create0 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_file.py FE [100%] 195s 195s ==================================== ERRORS ==================================== 195s _________________________ ERROR at teardown of test_a __________________________ 195s your snapshot is missing one value. 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s > assert 5==snapshot() 195s 195s test_file.py:7: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_create0/test_file.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 195s ERROR test_file.py::test_a - Failed: your snapshot is missing one value. 195s ========================== 1 failed, 1 error in 0.27s ========================== 195s ___________________________________ test_fix ___________________________________ 195s 195s project = .Project object at 0x748e18c9e180> 195s 195s def test_fix(project): 195s project.setup( 195s """\ 195s def test_a(): 195s assert 5==snapshot(4) 195s """ 195s ) 195s 195s result = project.run() 195s 195s > result.assert_outcomes(failed=1, errors=1) 195s E AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 1,...pped': 0, ...} 195s E 195s E Omitting 5 identical items, use -vv to show 195s E Differing items: 195s E {'errors': 0} != {'errors': 1} 195s E Use -v to get more diff 195s 195s /tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_pytest_plugin.py:71: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s write code: 195s # äöß 🐍 195s from inline_snapshot import snapshot 195s from inline_snapshot import outsource 195s 195s 195s def test_a(): 195s assert 5==snapshot(4) 195s 195s running: pytest 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_fix0 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_fix0 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_file.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s > assert 5==snapshot(4) 195s 195s test_file.py:7: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '5 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix0/test_file.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 195s ============================== 1 failed in 0.28s =============================== 195s _________________________________ test_update __________________________________ 195s 195s project = .Project object at 0x748e18c9f1a0> 195s 195s def test_update(project): 195s project.setup( 195s """\ 195s def test_a(): 195s assert "5" == snapshot('''5''') 195s """ 195s ) 195s 195s result = project.run() 195s 195s > result.assert_outcomes(passed=1) 195s E AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...} 195s E 195s E Omitting 4 identical items, use -vv to show 195s E Differing items: 195s E {'passed': 0} != {'passed': 1} 195s E {'failed': 1} != {'failed': 0} 195s E Use -v to get more diff 195s 195s /tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_pytest_plugin.py:118: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s write code: 195s # äöß 🐍 195s from inline_snapshot import snapshot 195s from inline_snapshot import outsource 195s 195s 195s def test_a(): 195s assert "5" == snapshot('''5''') 195s 195s running: pytest 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_update0 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_update0 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_file.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s > assert "5" == snapshot('''5''') 195s 195s test_file.py:7: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = "'5'" 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_update0/test_file.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 195s ============================== 1 failed in 0.27s =============================== 195s __________________________________ test_trim ___________________________________ 195s 195s project = .Project object at 0x748e18c9fe30> 195s 195s def test_trim(project): 195s project.setup( 195s """\ 195s def test_a(): 195s assert 5 in snapshot([4,5]) 195s """ 195s ) 195s 195s result = project.run() 195s 195s result.assert_outcomes(passed=1) 195s 195s assert result.report == snapshot( 195s """\ 195s Info: one snapshot can be trimmed (--inline-snapshot=trim) 195s You can also use --inline-snapshot=review to approve the changes interactively 195s """ 195s ) 195s 195s result = project.run("--inline-snapshot=trim") 195s 195s > assert result.report == snapshot( 195s """\ 195s -------------------------------- Trim snapshots -------------------------------- 195s +-------------------------------- test_file.py --------------------------------+ 195s | @@ -4,4 +4,4 @@ | 195s | | 195s | | 195s | | 195s | def test_a(): | 195s | - assert 5 in snapshot([4,5]) | 195s | + assert 5 in snapshot([5]) | 195s +------------------------------------------------------------------------------+ 195s These changes will be applied, because you used --inline-snapshot=trim 195s """ 195s ) 195s 195s /tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_pytest_plugin.py:178: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = "'-------------------------------- Trim snapshots --------------------------------'" 195s filename = PosixPath('/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_pytest_plugin.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s write code: 195s # äöß 🐍 195s from inline_snapshot import snapshot 195s from inline_snapshot import outsource 195s 195s 195s def test_a(): 195s assert 5 in snapshot([4,5]) 195s 195s running: pytest 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_trim0 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_trim0 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_file.py . [100%] 195s =============================== inline snapshot ================================ 195s Info: one snapshot can be trimmed (--inline-snapshot=trim) 195s 195s You can also use --inline-snapshot=review to approve the changes interactively 195s 195s ============================== 1 passed in 0.19s =============================== 195s running: pytest --inline-snapshot=trim 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_trim0 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_trim0 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_file.py . [100%] 195s =============================== inline snapshot ================================ 195s ──────────────────────────────── Trim snapshots ──────────────────────────────── 195s ----------------------------- Captured stderr call ----------------------------- 195s Traceback (most recent call last): 195s File "/usr/bin/pytest", line 8, in 195s sys.exit(console_main()) 195s ~~~~~~~~~~~~^^ 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 195s code = main() 195s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 195s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 195s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 195s return wrap_session(config, _main) 195s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 195s config.hook.pytest_sessionfinish( 195s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 195s session=session, exitstatus=session.exitstatus 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s ) 195s ^ 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ~~~~~~~~~~~~~~^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 195s teardown.send(result) # type: ignore[union-attr] 195s ~~~~~~~~~~~~~^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 195s self.config.hook.pytest_terminal_summary( 195s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 195s terminalreporter=self, exitstatus=exitstatus, config=self.config 195s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s ) 195s ^ 195s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 195s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 195s ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 195s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 195s ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 195s raise exception.with_traceback(exception.__traceback__) 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ~~~~~~~~~~~~~~^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 195s teardown.throw(exception) # type: ignore[union-attr] 195s ~~~~~~~~~~~~~~^^^^^^^^^^^ 195s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 195s return (yield) 195s ^^^^^ 195s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 195s res = hook_impl.function(*args) 195s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary 195s diff = file.diff() 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff 195s unified_diff(self.source.splitlines(), self.new_code().splitlines()), 195s ~~~~~~~~~~~~~^^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s ~~~~~~~~~~~^ 195s code, self.filename 195s ^^^^^^^^^^^^^^^^^^^ 195s ) 195s ^ 195s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 195s runner = CliRunner(mix_stderr=False) 195s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s ________________________________ test_multiple _________________________________ 195s 195s project = .Project object at 0x748e18b7f800> 195s 195s def test_multiple(project): 195s project.setup( 195s """\ 195s def test_a(): 195s assert "5" == snapshot('''5''') 195s assert 5 <= snapshot(8) 195s assert 5 == snapshot(4) 195s """ 195s ) 195s 195s result = project.run() 195s 195s > result.assert_outcomes(failed=1, errors=1) 195s E AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 1,...pped': 0, ...} 195s E 195s E Omitting 5 identical items, use -vv to show 195s E Differing items: 195s E {'errors': 0} != {'errors': 1} 195s E Use -v to get more diff 195s 195s /tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_pytest_plugin.py:214: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s write code: 195s # äöß 🐍 195s from inline_snapshot import snapshot 195s from inline_snapshot import outsource 195s 195s 195s def test_a(): 195s assert "5" == snapshot('''5''') 195s assert 5 <= snapshot(8) 195s assert 5 == snapshot(4) 195s 195s running: pytest 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_multiple0 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_multiple0 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_file.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s > assert "5" == snapshot('''5''') 195s 195s test_file.py:7: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = "'5'" 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_multiple0/test_file.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 195s ============================== 1 failed in 0.33s =============================== 195s _____________________________ test_multiple_report _____________________________ 195s 195s project = .Project object at 0x748e18b02030> 195s 195s def test_multiple_report(project): 195s project.setup( 195s """\ 195s def test_a(): 195s assert "5" == snapshot('''5''') 195s assert 5 <= snapshot(8) 195s assert 5 == snapshot(4) 195s """ 195s ) 195s 195s result = project.run("--inline-snapshot=trim,report") 195s 195s > assert result.report == snapshot( 195s """\ 195s -------------------------------- Fix snapshots --------------------------------- 195s +-------------------------------- test_file.py --------------------------------+ 195s | @@ -6,4 +6,4 @@ | 195s | | 195s | def test_a(): | 195s | assert "5" == snapshot('''5''') | 195s | assert 5 <= snapshot(8) | 195s | - assert 5 == snapshot(4) | 195s | + assert 5 == snapshot(5) | 195s +------------------------------------------------------------------------------+ 195s These changes are not applied. 195s Use --inline-snapshot=fix to apply them, or use the interactive mode with 195s --inline-snapshot=review 195s -------------------------------- Trim snapshots -------------------------------- 195s +-------------------------------- test_file.py --------------------------------+ 195s | @@ -5,5 +5,5 @@ | 195s | | 195s | | 195s | def test_a(): | 195s | assert "5" == snapshot('''5''') | 195s | - assert 5 <= snapshot(8) | 195s | + assert 5 <= snapshot(5) | 195s | assert 5 == snapshot(4) | 195s +------------------------------------------------------------------------------+ 195s These changes will be applied, because you used --inline-snapshot=trim 195s ------------------------------- Update snapshots ------------------------------- 195s +-------------------------------- test_file.py --------------------------------+ 195s | @@ -4,6 +4,6 @@ | 195s | | 195s | | 195s | | 195s | def test_a(): | 195s | - assert "5" == snapshot('''5''') | 195s | + assert "5" == snapshot("5") | 195s | assert 5 <= snapshot(5) | 195s | assert 5 == snapshot(4) | 195s +------------------------------------------------------------------------------+ 195s These changes are not applied. 195s Use --inline-snapshot=update to apply them, or use the interactive mode with 195s --inline-snapshot=review 195s """ 195s ) 195s 195s /tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_pytest_plugin.py:307: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = "''" 195s filename = PosixPath('/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_pytest_plugin.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s write code: 195s # äöß 🐍 195s from inline_snapshot import snapshot 195s from inline_snapshot import outsource 195s 195s 195s def test_a(): 195s assert "5" == snapshot('''5''') 195s assert 5 <= snapshot(8) 195s assert 5 == snapshot(4) 195s 195s running: pytest --inline-snapshot=trim,report 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_multiple_report0 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_multiple_report0 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_file.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s > assert "5" == snapshot('''5''') 195s 195s test_file.py:7: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = "'5'" 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_multiple_report0/test_file.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 195s ============================== 1 failed in 0.26s =============================== 195s ______________________________ test_black_config _______________________________ 195s 195s project = .Project object at 0x748e18b03530> 195s 195s def test_black_config(project): 195s project.setup( 195s """\ 195s def test_a(): 195s assert list(range(10)) == snapshot([]) 195s """ 195s ) 195s 195s > project.format() 195s 195s /tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_pytest_plugin.py:370: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/conftest.py:315: in format 195s format_code(self._filename.read_text("utf-8"), self._filename), "utf-8" 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import outsource\n\n\ndef test_a():\n assert list(range(10)) == snapshot([])\n' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_black_config0/test_file.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s write code: 195s # äöß 🐍 195s from inline_snapshot import snapshot 195s from inline_snapshot import outsource 195s 195s 195s def test_a(): 195s assert list(range(10)) == snapshot([]) 195s 195s ________________________________ test_disabled _________________________________ 195s 195s project = .Project object at 0x748e18b028a0> 195s 195s def test_disabled(project): 195s project.setup( 195s """\ 195s def test_a(): 195s assert 4==snapshot(5) 195s """ 195s ) 195s 195s result = project.run("--inline-snapshot=disable") 195s result.assert_outcomes(failed=1) 195s 195s result = project.run("--inline-snapshot=fix") 195s > assert project.source == snapshot( 195s """\ 195s def test_a(): 195s assert 4==snapshot(4) 195s """ 195s ) 195s 195s /tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_pytest_plugin.py:409: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '"""\\\ndef test_a():\n assert 4==snapshot(5)\n"""' 195s filename = PosixPath('/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_pytest_plugin.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s write code: 195s # äöß 🐍 195s from inline_snapshot import snapshot 195s from inline_snapshot import outsource 195s 195s 195s def test_a(): 195s assert 4==snapshot(5) 195s 195s running: pytest --inline-snapshot=disable 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_disabled0 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_disabled0 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_file.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s > assert 4==snapshot(5) 195s E assert 4 == 5 195s E + where 5 = snapshot(5) 195s 195s test_file.py:7: AssertionError 195s =========================== short test summary info ============================ 195s FAILED test_file.py::test_a - assert 4 == 5 195s ============================== 1 failed in 0.20s =============================== 195s running: pytest --inline-snapshot=fix 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_disabled0 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_disabled0 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_file.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s > assert 4==snapshot(5) 195s 195s test_file.py:7: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '4 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_disabled0/test_file.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 195s ============================== 1 failed in 0.26s =============================== 195s _________________________________ test_compare _________________________________ 195s 195s project = .Project object at 0x748e188ae510> 195s 195s def test_compare(project): 195s project.setup( 195s """\ 195s def test_a(): 195s assert "a"==snapshot("b") 195s """ 195s ) 195s 195s result = project.run() 195s > assert result.errorLines() == snapshot( 195s """\ 195s > assert "a"==snapshot("b") 195s E AssertionError: assert 'a' == 'b' 195s E ⏎ 195s E - b 195s E + a 195s """ 195s ) 195s 195s /tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_pytest_plugin.py:429: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '"""\\\n> assert "a"==snapshot("b")\n> runner = CliRunner(mix_stderr=False)\nE TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\n"""' 195s filename = PosixPath('/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_pytest_plugin.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s write code: 195s # äöß 🐍 195s from inline_snapshot import snapshot 195s from inline_snapshot import outsource 195s 195s 195s def test_a(): 195s assert "a"==snapshot("b") 195s 195s running: pytest 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_compare0 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_compare0 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_file.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s > assert "a"==snapshot("b") 195s 195s test_file.py:7: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = "'a'" 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_compare0/test_file.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 195s ============================== 1 failed in 0.30s =============================== 195s __________________________ test_assertion_error_loop ___________________________ 195s 195s project = .Project object at 0x748e18b00ad0> 195s 195s def test_assertion_error_loop(project): 195s project.setup( 195s """\ 195s for e in (1, 2): 195s assert e == snapshot() 195s """ 195s ) 195s result = project.run() 195s > assert result.errorLines() == snapshot( 195s """\ 195s E assert 2 == 1 195s E + where 1 = snapshot() 195s """ 195s ) 195s 195s /tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_pytest_plugin.py:466: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '"E TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'"' 195s filename = PosixPath('/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_pytest_plugin.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s write code: 195s # äöß 🐍 195s from inline_snapshot import snapshot 195s from inline_snapshot import outsource 195s 195s 195s for e in (1, 2): 195s assert e == snapshot() 195s 195s running: pytest 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_assertion_error_loop0 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_assertion_error_loop0 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 0 items / 1 error 195s 195s ==================================== ERRORS ==================================== 195s ________________________ ERROR collecting test_file.py _________________________ 195s test_file.py:7: in 195s assert e == snapshot() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 195s runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s ERROR test_file.py - TypeError: CliRunner.__init__() got an unexpected keywor... 195s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 195s =============================== 1 error in 0.26s =============================== 195s _____________________________ test_assertion_error _____________________________ 195s 195s project = .Project object at 0x748e188aecf0> 195s 195s def test_assertion_error(project): 195s project.setup("assert 2 == snapshot(1)") 195s result = project.run() 195s > assert result.errorLines() == snapshot( 195s """\ 195s E assert 2 == 1 195s E + where 1 = snapshot(1) 195s """ 195s ) 195s 195s /tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_pytest_plugin.py:493: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '"E TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'"' 195s filename = PosixPath('/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_pytest_plugin.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s write code: 195s # äöß 🐍 195s from inline_snapshot import snapshot 195s from inline_snapshot import outsource 195s 195s 195s assert 2 == snapshot(1) 195s running: pytest 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_assertion_error0 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_assertion_error0 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 0 items / 1 error 195s 195s ==================================== ERRORS ==================================== 195s ________________________ ERROR collecting test_file.py _________________________ 195s test_file.py:6: in 195s assert 2 == snapshot(1) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 195s runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s ERROR test_file.py - TypeError: CliRunner.__init__() got an unexpected keywor... 195s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 195s =============================== 1 error in 0.24s =============================== 195s _______________________ test_pytest_inlinesnapshot_auto ________________________ 195s 195s project = .Project object at 0x748e188adfa0> 195s 195s def test_pytest_inlinesnapshot_auto(project): 195s project.setup( 195s """\ 195s def test_something(): 195s assert 2 == snapshot(1) 195s """ 195s ) 195s result = project.run("--inline-snapshot=review", stdin=b"y\n") 195s > assert result.errorLines() == snapshot("") 195s 195s /tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_pytest_plugin.py:526: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '"""\\\n> assert 2 == snapshot(1)\n> runner = CliRunner(mix_stderr=False)\nE TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\n"""' 195s filename = PosixPath('/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_pytest_plugin.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s write code: 195s # äöß 🐍 195s from inline_snapshot import snapshot 195s from inline_snapshot import outsource 195s 195s 195s def test_something(): 195s assert 2 == snapshot(1) 195s 195s running: pytest --inline-snapshot=review 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_inlinesnapshot_auto0 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_inlinesnapshot_auto0 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_file.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ________________________________ test_something ________________________________ 195s 195s def test_something(): 195s > assert 2 == snapshot(1) 195s 195s test_file.py:7: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '2 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_inlinesnapshot_auto0/test_file.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_file.py::test_something - TypeError: CliRunner.__init__() got an ... 195s ============================== 1 failed in 0.25s =============================== 195s ________________________ test_persist_unknown_external _________________________ 195s 195s project = .Project object at 0x748e189cfe60> 195s 195s def test_persist_unknown_external(project): 195s project.setup( 195s """\ 195s from inline_snapshot import external, snapshot 195s 195s def test_sub_snapshot(): 195s external("123*.png") 195s assert 1==snapshot(2) 195s """ 195s ) 195s 195s result = project.run("--inline-snapshot=fix") 195s 195s > assert project.source == snapshot( 195s """\ 195s from inline_snapshot import external, snapshot 195s 195s def test_sub_snapshot(): 195s external("123*.png") 195s assert 1==snapshot(1) 195s """ 195s ) 195s 195s /tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_pytest_plugin.py:596: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '"""\\\nfrom inline_snapshot import external, snapshot\n\ndef test_sub_snapshot():\n external("123*.png")\n assert 1==snapshot(2)\n"""' 195s filename = PosixPath('/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_pytest_plugin.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s write code: 195s # äöß 🐍 195s from inline_snapshot import snapshot 195s from inline_snapshot import outsource 195s from inline_snapshot import external, snapshot 195s 195s def test_sub_snapshot(): 195s external("123*.png") 195s assert 1==snapshot(2) 195s 195s running: pytest --inline-snapshot=fix 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_persist_unknown_external0 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_persist_unknown_external0 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_file.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ______________________________ test_sub_snapshot _______________________________ 195s 195s def test_sub_snapshot(): 195s external("123*.png") 195s > assert 1==snapshot(2) 195s 195s test_file.py:8: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '1 ' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_persist_unknown_external0/test_file.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_file.py::test_sub_snapshot - TypeError: CliRunner.__init__() got ... 195s ============================== 1 failed in 0.25s =============================== 195s ___________________________ test_diff_multiple_files ___________________________ 195s 195s def test_diff_multiple_files(): 195s 195s Example( 195s { 195s "test_a.py": """ 195s from inline_snapshot import snapshot 195s 195s def test_a(): 195s assert 1==snapshot(2) 195s """, 195s "test_b.py": """ 195s from inline_snapshot import snapshot 195s 195s def test_b(): 195s assert 1==snapshot() 195s """, 195s } 195s > ).run_pytest( 195s ["--inline-snapshot=create,fix"], 195s changed_files=snapshot( 195s { 195s "test_b.py": """\ 195s 195s from inline_snapshot import snapshot 195s 195s def test_b(): 195s assert 1==snapshot(1) 195s \ 195s """, 195s "test_a.py": """\ 195s 195s from inline_snapshot import snapshot 195s 195s def test_a(): 195s assert 1==snapshot(1) 195s \ 195s """, 195s } 195s ), 195s report=snapshot( 195s """\ 195s ------------------------------- Create snapshots ------------------------------- 195s +--------------------------------- test_b.py ----------------------------------+ 195s | @@ -2,5 +2,5 @@ | 195s | | 195s | from inline_snapshot import snapshot | 195s | | 195s | def test_b(): | 195s | - assert 1==snapshot() | 195s | + assert 1==snapshot(1) | 195s +------------------------------------------------------------------------------+ 195s These changes will be applied, because you used --inline-snapshot=create 195s -------------------------------- Fix snapshots --------------------------------- 195s +--------------------------------- test_a.py ----------------------------------+ 195s | @@ -2,5 +2,5 @@ | 195s | | 195s | from inline_snapshot import snapshot | 195s | | 195s | def test_a(): | 195s | - assert 1==snapshot(2) | 195s | + assert 1==snapshot(1) | 195s +------------------------------------------------------------------------------+ 195s These changes will be applied, because you used --inline-snapshot=fix\ 195s """ 195s ), 195s ) 195s 195s tests/test_pytest_plugin.py:626: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:319: in run_pytest 195s assert normalize(report_str) == report, repr(report_str) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = "''" 195s filename = PosixPath('/tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_pytest_plugin.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: test_a.py 195s 195s from inline_snapshot import snapshot 195s 195s def test_a(): 195s assert 1==snapshot(2) 195s 195s 195s file: test_b.py 195s 195s from inline_snapshot import snapshot 195s 195s def test_b(): 195s assert 1==snapshot() 195s 195s 195s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create,fix 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmptr0gkiqm 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 2 items 195s 195s test_a.py F [ 50%] 195s test_b.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ____________________________________ test_a ____________________________________ 195s 195s def test_a(): 195s > assert 1==snapshot(2) 195s 195s test_a.py:5: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '1 ', filename = PosixPath('/tmp/tmptr0gkiqm/test_a.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ____________________________________ test_b ____________________________________ 195s 195s def test_b(): 195s > assert 1==snapshot() 195s 195s test_b.py:5: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '', filename = PosixPath('/tmp/tmptr0gkiqm/test_b.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 195s FAILED test_b.py::test_b - TypeError: CliRunner.__init__() got an unexpected ... 195s ============================== 2 failed in 0.21s =============================== 195s 195s stderr: 195s 195s ___________________ test_storage_dir_config[tests/snapshots] ___________________ 195s 195s project = .Project object at 0x748e18965cd0> 195s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config_tests_0') 195s storage_dir = 'tests/snapshots' 195s 195s @pytest.mark.parametrize("storage_dir", ["tests/snapshots", None]) 195s def test_storage_dir_config(project, tmp_path, storage_dir): 195s # Relative path case: `tests/snapshots` (parametrized). 195s # Absolute path case: `tmp_path / "snapshots"` (parametrized as `None`). 195s if not storage_dir: 195s storage_dir = tmp_path / "snapshots" 195s 195s project.pyproject( 195s f""" 195s [tool.inline-snapshot] 195s storage-dir = "{storage_dir}" 195s """ 195s ) 195s 195s project.setup( 195s """ 195s from inline_snapshot import outsource, snapshot 195s 195s def test_outsource(): 195s assert outsource("hello", suffix=".html") == snapshot() 195s """ 195s ) 195s 195s result = project.run("--inline-snapshot=create") 195s > assert result.ret == 0 195s E assert == 0 195s E + where = .ret 195s 195s /tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_pytest_plugin.py:754: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s write code: 195s # äöß 🐍 195s from inline_snapshot import snapshot 195s from inline_snapshot import outsource 195s 195s 195s 195s from inline_snapshot import outsource, snapshot 195s 195s def test_outsource(): 195s assert outsource("hello", suffix=".html") == snapshot() 195s 195s running: pytest --inline-snapshot=create 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config0 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config0 195s configfile: pyproject.toml 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_file.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ________________________________ test_outsource ________________________________ 195s 195s def test_outsource(): 195s > assert outsource("hello", suffix=".html") == snapshot() 195s 195s test_file.py:10: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config0/test_file.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_file.py::test_outsource - TypeError: CliRunner.__init__() got an ... 195s ============================== 1 failed in 0.25s =============================== 195s ________________________ test_storage_dir_config[None] _________________________ 195s 195s project = .Project object at 0x748e189677d0> 195s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config_None_0') 195s storage_dir = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config_None_0/snapshots') 195s 195s @pytest.mark.parametrize("storage_dir", ["tests/snapshots", None]) 195s def test_storage_dir_config(project, tmp_path, storage_dir): 195s # Relative path case: `tests/snapshots` (parametrized). 195s # Absolute path case: `tmp_path / "snapshots"` (parametrized as `None`). 195s if not storage_dir: 195s storage_dir = tmp_path / "snapshots" 195s 195s project.pyproject( 195s f""" 195s [tool.inline-snapshot] 195s storage-dir = "{storage_dir}" 195s """ 195s ) 195s 195s project.setup( 195s """ 195s from inline_snapshot import outsource, snapshot 195s 195s def test_outsource(): 195s assert outsource("hello", suffix=".html") == snapshot() 195s """ 195s ) 195s 195s result = project.run("--inline-snapshot=create") 195s > assert result.ret == 0 195s E assert == 0 195s E + where = .ret 195s 195s /tmp/autopkgtest.WzbXtF/autopkgtest_tmp/tests/test_pytest_plugin.py:754: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s write code: 195s # äöß 🐍 195s from inline_snapshot import snapshot 195s from inline_snapshot import outsource 195s 195s 195s 195s from inline_snapshot import outsource, snapshot 195s 195s def test_outsource(): 195s assert outsource("hello", suffix=".html") == snapshot() 195s 195s running: pytest --inline-snapshot=create 195s in: /tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config1 195s ============================= test session starts ============================== 195s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config1 195s configfile: pyproject.toml 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s test_file.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ________________________________ test_outsource ________________________________ 195s 195s def test_outsource(): 195s > assert outsource("hello", suffix=".html") == snapshot() 195s 195s test_file.py:10: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config1/test_file.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED test_file.py::test_outsource - TypeError: CliRunner.__init__() got an ... 195s ============================== 1 failed in 0.24s =============================== 195s __________________ test_find_pyproject_in_parent_directories ___________________ 195s 195s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_find_pyproject_in_parent_0') 195s 195s def test_find_pyproject_in_parent_directories(tmp_path): 195s 195s Example( 195s { 195s "pyproject.toml": """\ 195s [tool.inline-snapshot] 195s hash-length=2 195s """, 195s "project/pytest.ini": "", 195s "project/test_something.py": """\ 195s from inline_snapshot import outsource,snapshot,external 195s 195s def test_something(): 195s assert outsource("test") == snapshot() 195s """, 195s } 195s > ).run_pytest( 195s ["--rootdir", "./project", "--inline-snapshot=create"], 195s changed_files=snapshot( 195s { 195s "project/test_something.py": """\ 195s from inline_snapshot import outsource,snapshot,external 195s 195s def test_something(): 195s assert outsource("test") == snapshot(external("9f*.txt")) 195s """ 195s } 195s ), 195s ) 195s 195s tests/test_pytest_plugin.py:790: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s self = 195s args = ['--rootdir', './project', '--inline-snapshot=create'] 195s 195s def run_pytest( 195s self, 195s args: list[str] = [], 195s *, 195s term_columns=80, 195s env: dict[str, str] = {}, 195s changed_files: Snapshot[dict[str, str]] | None = None, 195s report: Snapshot[str] | None = None, 195s stderr: Snapshot[str] | None = None, 195s returncode: Snapshot[int] | None = None, 195s ) -> Example: 195s """Run pytest with the given args and env variables in an seperate 195s process. 195s 195s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 195s 195s Parameters: 195s args: pytest arguments like "--inline-snapshot=fix" 195s env: dict of environment variables 195s changed_files: snapshot of files which are changed by this run. 195s report: snapshot of the report at the end of the pytest run. 195s stderr: pytest stderr output 195s returncode: snapshot of the pytest returncode. 195s 195s Returns: 195s A new Example instance which contains the changed files. 195s """ 195s 195s with TemporaryDirectory() as dir: 195s tmp_path = Path(dir) 195s self._write_files(tmp_path) 195s 195s cmd = [sys.executable, "-m", "pytest", *args] 195s 195s command_env = dict(os.environ) 195s command_env["TERM"] = "unknown" 195s command_env["COLUMNS"] = str( 195s term_columns + 1 if platform.system() == "Windows" else term_columns 195s ) 195s command_env.pop("CI", None) 195s 195s command_env.update(env) 195s 195s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 195s 195s print("run>", *cmd) 195s print("stdout:") 195s print(result.stdout.decode()) 195s print("stderr:") 195s print(result.stderr.decode()) 195s 195s if returncode is not None: 195s assert result.returncode == returncode 195s 195s if stderr is not None: 195s assert result.stderr.decode() == stderr 195s 195s if report is not None: 195s 195s report_list = [] 195s record = False 195s for line in result.stdout.decode().splitlines(): 195s line = line.strip() 195s if line.startswith("===="): 195s record = False 195s 195s if record and line: 195s report_list.append(line) 195s 195s if line.startswith("====") and "inline snapshot" in line: 195s record = True 195s 195s report_str = "\n".join(report_list) 195s 195s assert normalize(report_str) == report, repr(report_str) 195s 195s if changed_files is not None: 195s current_files = {} 195s 195s for name, content in sorted(self._read_files(tmp_path).items()): 195s if name not in self.files or self.files[name] != content: 195s current_files[name] = content 195s > assert changed_files == current_files 195s E assert {'project/tes...9f*.txt"))\n'} == {} 195s E 195s E Left contains 1 more item: 195s E {'project/test_something.py': 'from inline_snapshot import ' 195s E 'outsource,snapshot,external\n' 195s E '\n' 195s E 'def test_something():\n' 195s E ' assert outsource("test") == ' 195s E 'snapshot(external("9f*.txt"))\n'} 195s E Use -v to get more diff 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 195s ----------------------------- Captured stdout call ----------------------------- 195s file: pyproject.toml 195s [tool.inline-snapshot] 195s hash-length=2 195s 195s 195s file: project/pytest.ini 195s 195s 195s file: project/test_something.py 195s from inline_snapshot import outsource,snapshot,external 195s 195s def test_something(): 195s assert outsource("test") == snapshot() 195s 195s 195s run> /usr/bin/python3.12 -m pytest --rootdir ./project --inline-snapshot=create 195s stdout: 195s ============================= test session starts ============================== 195s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 195s rootdir: /tmp/tmpmdei5evw/project 195s configfile: ../pyproject.toml 195s plugins: pytest_freezer-0.4.9, subtests-0.13.1, hypothesis-6.125.2, inline-snapshot-0.19.3, time-machine-2.16.0, typeguard-4.4.1, mock-3.14.0 195s collected 1 item 195s 195s project/test_something.py F [100%] 195s 195s =================================== FAILURES =================================== 195s ________________________________ test_something ________________________________ 195s 195s def test_something(): 195s > assert outsource("test") == snapshot() 195s 195s project/test_something.py:4: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '', filename = PosixPath('/tmp/tmpmdei5evw/project/test_something.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s =============================== inline snapshot ================================ 195s =========================== short test summary info ============================ 195s FAILED project/test_something.py::test_something - TypeError: CliRunner.__ini... 195s ============================== 1 failed in 0.20s =============================== 195s 195s stderr: 195s 195s _________________________________ test_rewrite _________________________________ 195s 195s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_rewrite0') 195s 195s def test_rewrite(tmp_path): 195s file = tmp_path / "file.txt" 195s file.write_text( 195s """ 195s 12345 195s 12345 195s 12345 195s """, 195s "utf-8", 195s ) 195s 195s with ChangeRecorder().activate() as recorder: 195s s = recorder.change_set() 195s 195s s.replace(((2, 2), (2, 3)), "a", filename=file) 195s s.delete(((3, 2), (3, 3)), filename=file) 195s s.insert((4, 2), "c", filename=file) 195s 195s assert recorder.num_fixes() == 1 195s > recorder.fix_all() 195s 195s tests/test_rewrite_code.py:43: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 195s file.rewrite() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 195s new_code = self.new_code() 195s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 195s format_whole_file = enforce_formatting() or code == format_code( 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '\n12345\n12345\n12345\n' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_rewrite0/file.txt') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ______________________________ test_string_update ______________________________ 195s 195s check_update = .w at 0x748e189ee660> 195s 195s def test_string_update(check_update): 195s # black --preview wraps strings to keep the line length. 195s # string concatenation should produce updates. 195s assert ( 195s check_update( 195s 'assert "ab" == snapshot("a" "b")', reported_flags="", flags="update" 195s ) 195s == 'assert "ab" == snapshot("a" "b")' 195s ) 195s 195s assert ( 195s check_update( 195s 'assert "ab" == snapshot("a"\n "b")', reported_flags="", flags="update" 195s ) 195s == 'assert "ab" == snapshot("a"\n "b")' 195s ) 195s 195s > assert check_update( 195s 'assert "ab\\nc" == snapshot("a"\n "b\\nc")', flags="update" 195s ) == snapshot( 195s '''\ 195s assert "ab\\nc" == snapshot("""\\ 195s ab 195s c\\ 195s """)\ 195s ''' 195s ) 195s 195s tests/test_string.py:26: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:114: in run 195s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 195s /tmp/pytest-of-ubuntu/pytest-0/test_string_update0/test_5.py:9: in 195s assert "ab\nc" == snapshot("a" 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 195s return self == other 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 195s self._changes.append(next(it)) 195s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 195s new_code = self.context.file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '"""\\\nab\nc\\\n"""' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_string_update0/test_5.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert "ab" == snapshot("a" "b") 195s reported_flags: set() 195s run: pytest --inline-snapshot= 195s output: 195s |assert "ab" == snapshot("a" "b") 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert "ab" == snapshot("a" "b") 195s reported_flags: set() 195s run: pytest --inline-snapshot=update 195s output: 195s |assert "ab" == snapshot("a" "b") 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert "ab" == snapshot("a" 195s | "b") 195s reported_flags: set() 195s run: pytest --inline-snapshot= 195s output: 195s |assert "ab" == snapshot("a" 195s | "b") 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert "ab" == snapshot("a" 195s | "b") 195s reported_flags: set() 195s run: pytest --inline-snapshot=update 195s output: 195s |assert "ab" == snapshot("a" 195s | "b") 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |assert "ab\nc" == snapshot("a" 195s | "b\nc") 195s _____________________________ test_string_newline ______________________________ 195s 195s check_update = .w at 0x748e189efd80> 195s 195s def test_string_newline(check_update): 195s > assert check_update('s = snapshot("a\\nb")', flags="update") == snapshot( 195s '''\ 195s s = snapshot("""\\ 195s a 195s b\\ 195s """)\ 195s ''' 195s ) 195s 195s tests/test_string.py:46: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:218: in _get_changes 195s yield from handle(self._ast_node, self._old_value) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:206: in handle 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '"""\\\na\nb\\\n"""' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_string_newline0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot("a\nb") 195s ___________________________ test_string_quote_choice ___________________________ 195s 195s check_update = .w at 0x748e189b98a0> 195s 195s def test_string_quote_choice(check_update): 195s > assert check_update( 195s "s = snapshot(\" \\'\\'\\' \\'\\'\\' \\\"\\\"\\\"\\nother_line\")", 195s flags="update", 195s ) == snapshot( 195s '''\ 195s s = snapshot("""\\ 195s \'\'\' \'\'\' \\"\\"\\" 195s other_line\\ 195s """)\ 195s ''' 195s ) 195s 195s tests/test_string.py:115: 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s tests/conftest.py:49: in w 195s s = source(source_code) 195s tests/conftest.py:158: in w 195s return Source(source=source).run() 195s tests/conftest.py:125: in run 195s changes += snapshot._changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 195s yield from self._value._get_changes() 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:218: in _get_changes 195s yield from handle(self._ast_node, self._old_value) 195s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:206: in handle 195s new_code = self._file._token_to_code(new_token) 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 195s return self._format(tokenize.untokenize(tokens)).strip() 195s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 195s return format_code(text, Path(self._source.filename)) 195s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 195s 195s text = '"""\\\n \'\'\' \'\'\' \\"\\"\\"\nother_line\\\n"""' 195s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_string_quote_choice0/test_1.py') 195s 195s def format_code(text, filename): 195s if _config.config.format_command is not None: 195s format_command = _config.config.format_command.format(filename=filename) 195s result = sp.run( 195s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 195s ) 195s if result.returncode != 0: 195s raise_problem( 195s f"""\ 195s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 195s """ 195s + result.stdout.decode("utf-8") 195s + result.stderr.decode("utf-8") 195s ) 195s return text 195s return result.stdout.decode("utf-8") 195s 195s try: 195s from black import main 195s from click.testing import CliRunner 195s except ImportError: 195s raise_problem( 195s f"""\ 195s [b]inline-snapshot is not able to format your code.[/b] 195s This issue can be solved by: 195s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 195s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 195s """ 195s ) 195s return text 195s 195s with warnings.catch_warnings(): 195s warnings.simplefilter("ignore") 195s 195s > runner = CliRunner(mix_stderr=False) 195s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 195s 195s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 195s ----------------------------- Captured stdout call ----------------------------- 195s 195s input: 195s |""" 195s |PYTEST_DONT_REWRITE 195s |""" 195s |# äöß 🐍 195s |from inline_snapshot import snapshot 195s |from inline_snapshot import external 195s |from inline_snapshot import outsource 195s | 195s |s = snapshot(" \'\'\' \'\'\' \"\"\"\nother_line") 195s =============================== warnings summary =============================== 195s tests/adapter/test_sequence.py:64 195s /tmp/autopkgtest.WzbXtF/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 195s @pytest.mark.no_rewriting 195s 195s tests/test_inline_snapshot.py:17 195s /tmp/autopkgtest.WzbXtF/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 195s @pytest.mark.no_rewriting 195s 195s tests/test_inline_snapshot.py:24 195s /tmp/autopkgtest.WzbXtF/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 195s @pytest.mark.no_rewriting 195s 195s tests/test_pypy.py:8 195s /tmp/autopkgtest.WzbXtF/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 195s @pytest.mark.no_rewriting 195s 195s tests/test_pytest_plugin.py:275 195s /tmp/autopkgtest.WzbXtF/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 195s @pytest.mark.no_rewriting 195s 195s tests/test_pytest_plugin.py:501 195s /tmp/autopkgtest.WzbXtF/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 195s @pytest.mark.no_rewriting 195s 195s -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html 195s =============================== inline snapshot ================================ 195s Error: one snapshot has incorrect values (--inline-snapshot=fix) 195s 195s You can also use --inline-snapshot=review to approve the changes interactively 195s =========================== short test summary info ============================ 195s FAILED tests/adapter/test_dataclass.py::test_unmanaged - TypeError: CliRunner... 195s FAILED tests/adapter/test_dataclass.py::test_reeval - assert None == ('TypeEr... 195s FAILED tests/adapter/test_dataclass.py::test_dataclass_default_value - TypeEr... 195s FAILED tests/adapter/test_dataclass.py::test_attrs_default_value - AssertionE... 195s FAILED tests/adapter/test_dataclass.py::test_attrs_field_repr - AssertionErro... 195s FAILED tests/adapter/test_dataclass.py::test_disabled[executing] - TypeError:... 195s FAILED tests/adapter/test_dataclass.py::test_disabled[without-executing] - At... 195s FAILED tests/adapter/test_dataclass.py::test_add_argument - TypeError: CliRun... 195s FAILED tests/adapter/test_dataclass.py::test_remove_positional_argument - ass... 195s FAILED tests/adapter/test_dataclass.py::test_namedtuple - assert {'test_somet... 195s FAILED tests/adapter/test_dataclass.py::test_defaultdict - assert {'test_some... 195s FAILED tests/adapter/test_dataclass.py::test_dataclass_field_repr - assert No... 195s FAILED tests/adapter/test_dataclass.py::test_dataclass_var - assert None == (... 195s FAILED tests/adapter/test_dict.py::test_dict_var - assert None == ('TypeError... 195s FAILED tests/adapter/test_general.py::test_adapter_mismatch - assert None == ... 195s FAILED tests/adapter/test_sequence.py::test_list_adapter_create_inner_snapshot 195s FAILED tests/adapter/test_sequence.py::test_list_adapter_fix_inner_snapshot 195s FAILED tests/adapter/test_sequence.py::test_list_var - assert None == ('TypeE... 195s FAILED tests/test_change.py::test_change_function_args - TypeError: CliRunner... 195s FAILED tests/test_code_repr.py::test_enum - TypeError: CliRunner.__init__() g... 195s FAILED tests/test_code_repr.py::test_snapshot_generates_hasrepr - TypeError: ... 195s FAILED tests/test_code_repr.py::test_enum_in_dataclass - TypeError: CliRunner... 195s FAILED tests/test_code_repr.py::test_flag - TypeError: CliRunner.__init__() g... 195s FAILED tests/test_code_repr.py::test_type - TypeError: CliRunner.__init__() g... 195s FAILED tests/test_code_repr.py::test_qualname - assert None == ('TypeError:\n... 195s FAILED tests/test_code_repr.py::test_invalid_repr - TypeError: CliRunner.__in... 195s FAILED tests/test_config.py::test_config_pyproject - AssertionError: assert {... 195s FAILED tests/test_config.py::test_config_env - AssertionError: assert {'test_... 195s FAILED tests/test_config.py::test_shortcuts - AssertionError: assert {'test_a... 195s FAILED tests/test_config.py::test_default_shortcuts - AssertionError: assert ... 195s FAILED tests/test_dirty_equals.py::test_compare_dirty_equals_twice - assert N... 195s FAILED tests/test_dirty_equals.py::test_dirty_equals_with_changing_args - ass... 195s FAILED tests/test_example.py::test_example - AssertionError: assert [] == ['f... 195s FAILED tests/test_external.py::test_basic - TypeError: CliRunner.__init__() g... 195s FAILED tests/test_external.py::test_persist - TypeError: CliRunner.__init__()... 195s FAILED tests/test_external.py::test_pytest_compare_external - TypeError: CliR... 195s FAILED tests/test_external.py::test_pytest_compare_external_bytes - TypeError... 195s FAILED tests/test_external.py::test_pytest_existing_external_import - TypeErr... 195s FAILED tests/test_external.py::test_pytest_trim_external - TypeError: CliRunn... 195s FAILED tests/test_external.py::test_pytest_new_external - TypeError: CliRunne... 195s FAILED tests/test_external.py::test_pytest_config_hash_length - TypeError: Cl... 195s FAILED tests/test_external.py::test_no_imports - AssertionError: assert {'err... 195s FAILED tests/test_external.py::test_ensure_imports - TypeError: CliRunner.__i... 195s FAILED tests/test_external.py::test_ensure_imports_with_comment - TypeError: ... 195s FAILED tests/test_external.py::test_new_externals - TypeError: CliRunner.__in... 195s FAILED tests/test_formating.py::test_black_formatting_error - assert None == ... 195s FAILED tests/test_formating.py::test_fstring_139 - AssertionError: assert 1 == 0 195s [assert 4 == snapshot()] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 4 == snapshot({})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 4 == snapshot(5)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 4 == snapshot({0: 5})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 4 == snapshot(2+2)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 4 == snapshot({0: 2+2})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 4 <= snapshot()] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 4 <= snapshot({})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 4 <= snapshot(5)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 4 <= snapshot({0: 5})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 5 <= snapshot(4)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 5 <= snapshot({0: 4})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 5 <= snapshot(3+2)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 5 <= snapshot({0: 3+2})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 5 >= snapshot()] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 5 >= snapshot({})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 5 >= snapshot(4)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 5 >= snapshot({0: 4})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 4 >= snapshot(5)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 4 >= snapshot({0: 5})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 5 >= snapshot(3+2)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 5 >= snapshot({0: 3+2})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 5 in snapshot()] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 5 in snapshot({})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 5 in snapshot([4, 5])] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 5 in snapshot({0: [4, 5]})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 5 in snapshot([])] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 5 in snapshot({0: []})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 5 in snapshot([3+2])] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s [assert 5 in snapshot({0: [3+2]})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) fix(==)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) update(==)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) create(<=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) trim(<=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) fix(<=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) update(<=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) create(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) trim(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) fix(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) update(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) create(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) trim(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) fix(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) update(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) update(==)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) create(<=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) trim(<=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) fix(<=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) update(<=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) create(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) trim(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) fix(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) update(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) create(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) trim(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) fix(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) update(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) create(<=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) trim(<=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) fix(<=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) update(<=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) create(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) trim(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) fix(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) update(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) create(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) trim(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) fix(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) update(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) trim(<=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) fix(<=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) update(<=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) create(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) trim(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) fix(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) update(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) create(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) trim(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) fix(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) update(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) fix(<=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) update(<=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) create(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) trim(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) fix(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) update(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) create(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) trim(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) fix(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) update(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) update(<=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) create(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) trim(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) fix(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) update(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) create(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) trim(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) fix(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) update(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) create(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) trim(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) fix(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) update(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) create(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) trim(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) fix(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) update(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) trim(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) fix(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) update(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) create(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) trim(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) fix(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) update(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) fix(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) update(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) create(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) trim(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) fix(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) update(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) update(>=)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) create(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) trim(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) fix(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) update(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(>=) create(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(>=) trim(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(>=) fix(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(>=) update(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(in) trim(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(in) fix(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(in) update(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(in) fix(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(in) update(in)] 195s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(in) update(in)] 195s FAILED tests/test_inline_snapshot.py::test_mutable_values - TypeError: CliRun... 195s FAILED tests/test_inline_snapshot.py::test_comparison - TypeError: CliRunner.... 195s FAILED tests/test_inline_snapshot.py::test_ge - TypeError: CliRunner.__init__... 195s FAILED tests/test_inline_snapshot.py::test_le - TypeError: CliRunner.__init__... 195s FAILED tests/test_inline_snapshot.py::test_contains - TypeError: CliRunner.__... 195s FAILED tests/test_inline_snapshot.py::test_getitem - TypeError: CliRunner.__i... 195s FAILED tests/test_inline_snapshot.py::test_assert - TypeError: CliRunner.__in... 195s FAILED tests/test_inline_snapshot.py::test_format_file - TypeError: CliRunner... 195s FAILED tests/test_inline_snapshot.py::test_format_value - TypeError: CliRunne... 195s FAILED tests/test_inline_snapshot.py::test_type_error - TypeError: CliRunner.... 195s FAILED tests/test_inline_snapshot.py::test_different_snapshot_name - TypeErro... 195s FAILED tests/test_inline_snapshot.py::test_quoting_change_is_no_update - Type... 195s FAILED tests/test_inline_snapshot.py::test_trailing_comma - TypeError: CliRun... 195s FAILED tests/test_inline_snapshot.py::test_is - assert None == ('TypeError:\n... 195s FAILED tests/test_is.py::test_missing_is - TypeError: CliRunner.__init__() go... 195s FAILED tests/test_is_normalized.py::test_repr - assert None == ('TypeError:\n... 195s FAILED tests/test_preserve_values.py::test_fix_list_fix - TypeError: CliRunne... 195s FAILED tests/test_preserve_values.py::test_fix_list_insert - TypeError: CliRu... 195s FAILED tests/test_preserve_values.py::test_fix_list_delete - TypeError: CliRu... 195s FAILED tests/test_preserve_values.py::test_fix_tuple_delete - TypeError: CliR... 195s FAILED tests/test_preserve_values.py::test_fix_dict_change - TypeError: CliRu... 195s FAILED tests/test_preserve_values.py::test_fix_dict_remove - TypeError: CliRu... 195s FAILED tests/test_preserve_values.py::test_fix_dict_insert - TypeError: CliRu... 195s FAILED tests/test_preserve_values.py::test_fix_dict_with_non_literal_keys - T... 195s FAILED tests/test_preserve_values.py::test_no_update_for_dirty_equals - TypeE... 195s FAILED tests/test_preserve_values.py::test_preserve_case_from_original_mr - T... 195s [[5, 5, 5] -> [] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[5, 5] -> [8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 195s [[5, 5, 2+2] -> [4] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[5, 5, 3] -> [3] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[5, 5] -> [8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 195s [[5] -> [8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 195s [[5, 2+2] -> [8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[5, 3] -> [8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[5, 2+2, 5] -> [4] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[5, 2+2] -> [4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[5, 2+2, 2+2] -> [4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[5, 2+2, 3] -> [4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[5, 3, 5] -> [3] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[5, 3] -> [3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[5, 3, 2+2] -> [3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[5, 3, 3] -> [3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[5, 5] -> [8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 195s [[5] -> [8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 195s [[5, 2+2] -> [8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[5, 3] -> [8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[5] -> [8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 195s [[] -> [8, 8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[2+2] -> [8, 8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[3] -> [8, 8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[2+2, 5] -> [8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[2+2] -> [8, 4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[2+2, 2+2] -> [8, 4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[2+2, 3] -> [8, 4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[3, 5] -> [8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[3] -> [8, 3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[3, 2+2] -> [8, 3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[3, 3] -> [8, 3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[2+2, 5, 5] -> [4] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[2+2, 5] -> [4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[2+2, 5, 2+2] -> [4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[2+2, 5, 3] -> [4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[2+2, 5] -> [4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[2+2] -> [4, 8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[2+2, 2+2] -> [4, 8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[2+2, 3] -> [4, 8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[2+2, 2+2, 5] -> [4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[2+2, 2+2] -> [4, 4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[2+2, 2+2, 2+2] -> [4, 4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[2+2, 2+2, 3] -> [4, 4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[2+2, 3, 5] -> [4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[2+2, 3] -> [4, 3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[2+2, 3, 2+2] -> [4, 3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[2+2, 3, 3] -> [4, 3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[3, 5, 5] -> [3] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[3, 5] -> [3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[3, 5, 2+2] -> [3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[3, 5, 3] -> [3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[3, 5] -> [3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[3] -> [3, 8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[3, 2+2] -> [3, 8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[3, 3] -> [3, 8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[3, 2+2, 5] -> [3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[3, 2+2] -> [3, 4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[3, 2+2, 2+2] -> [3, 4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[3, 2+2, 3] -> [3, 4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[3, 3, 5] -> [3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[3, 3] -> [3, 3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [[3, 3, 2+2] -> [3, 3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(5, 5, 5) -> () ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(5, 5) -> (8,) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 195s [(5, 5, 2+2) -> (4,) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(5, 5, 3) -> (3,) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(5, 5) -> (8,) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 195s [(5,) -> (8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 195s [(5, 2+2) -> (8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(5, 3) -> (8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(5, 2+2, 5) -> (4,) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(5, 2+2) -> (4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(5, 2+2, 2+2) -> (4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(5, 2+2, 3) -> (4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(5, 3, 5) -> (3,) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(5, 3) -> (3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(5, 3, 2+2) -> (3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(5, 3, 3) -> (3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(5, 5) -> (8,) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 195s [(5,) -> (8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 195s [(5, 2+2) -> (8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(5, 3) -> (8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(5,) -> (8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 195s [() -> (8, 8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(2+2,) -> (8, 8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(3,) -> (8, 8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(2+2, 5) -> (8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(2+2,) -> (8, 4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(2+2, 2+2) -> (8, 4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(2+2, 3) -> (8, 4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(3, 5) -> (8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(3,) -> (8, 3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(3, 2+2) -> (8, 3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(3, 3) -> (8, 3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(2+2, 5, 5) -> (4,) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(2+2, 5) -> (4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(2+2, 5, 2+2) -> (4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(2+2, 5, 3) -> (4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(2+2, 5) -> (4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(2+2,) -> (4, 8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(2+2, 2+2) -> (4, 8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(2+2, 3) -> (4, 8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(2+2, 2+2, 5) -> (4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(2+2, 2+2) -> (4, 4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(2+2, 2+2, 2+2) -> (4, 4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(2+2, 2+2, 3) -> (4, 4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(2+2, 3, 5) -> (4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(2+2, 3) -> (4, 3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(2+2, 3, 2+2) -> (4, 3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(2+2, 3, 3) -> (4, 3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(3, 5, 5) -> (3,) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(3, 5) -> (3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(3, 5, 2+2) -> (3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(3, 5, 3) -> (3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(3, 5) -> (3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(3,) -> (3, 8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(3, 2+2) -> (3, 8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(3, 3) -> (3, 8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(3, 2+2, 5) -> (3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(3, 2+2) -> (3, 4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(3, 2+2, 2+2) -> (3, 4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(3, 2+2, 3) -> (3, 4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(3, 3, 5) -> (3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(3, 3) -> (3, 3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [(3, 3, 2+2) -> (3, 3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 5, 1: 5, 2: 5} -> {} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 5, 1: 5} -> {2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 5, 1: 5, 2: 2+2} -> {2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 5, 1: 5, 2: 3} -> {2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 5, 2: 5} -> {1: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 5} -> {1: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 5, 2: 2+2} -> {1: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 5, 2: 3} -> {1: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 5, 1: 2+2, 2: 5} -> {1: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 5, 1: 2+2} -> {1: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 5, 1: 2+2, 2: 2+2} -> {1: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 5, 1: 2+2, 2: 3} -> {1: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 5, 1: 3, 2: 5} -> {1: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 5, 1: 3} -> {1: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 5, 1: 3, 2: 2+2} -> {1: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 5, 1: 3, 2: 3} -> {1: 3, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{1: 5, 2: 5} -> {0: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{1: 5} -> {0: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{1: 5, 2: 2+2} -> {0: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{1: 5, 2: 3} -> {0: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{2: 5} -> {0: 8, 1: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{} -> {0: 8, 1: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{2: 2+2} -> {0: 8, 1: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{2: 3} -> {0: 8, 1: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{1: 2+2, 2: 5} -> {0: 8, 1: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{1: 2+2} -> {0: 8, 1: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{1: 2+2, 2: 2+2} -> {0: 8, 1: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{1: 2+2, 2: 3} -> {0: 8, 1: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{1: 3, 2: 5} -> {0: 8, 1: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{1: 3} -> {0: 8, 1: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{1: 3, 2: 2+2} -> {0: 8, 1: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{1: 3, 2: 3} -> {0: 8, 1: 3, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 2+2, 1: 5, 2: 5} -> {0: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 2+2, 1: 5} -> {0: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 2+2, 1: 5, 2: 2+2} -> {0: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 2+2, 1: 5, 2: 3} -> {0: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 2+2, 2: 5} -> {0: 4, 1: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 2+2} -> {0: 4, 1: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 2+2, 2: 2+2} -> {0: 4, 1: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 2+2, 2: 3} -> {0: 4, 1: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 2+2, 1: 2+2, 2: 5} -> {0: 4, 1: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 2+2, 1: 2+2} -> {0: 4, 1: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 2+2, 1: 2+2, 2: 2+2} -> {0: 4, 1: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 2+2, 1: 2+2, 2: 3} -> {0: 4, 1: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 2+2, 1: 3, 2: 5} -> {0: 4, 1: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 2+2, 1: 3} -> {0: 4, 1: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 2+2, 1: 3, 2: 2+2} -> {0: 4, 1: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 2+2, 1: 3, 2: 3} -> {0: 4, 1: 3, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 3, 1: 5, 2: 5} -> {0: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 3, 1: 5} -> {0: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 3, 1: 5, 2: 2+2} -> {0: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 3, 1: 5, 2: 3} -> {0: 3, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 3, 2: 5} -> {0: 3, 1: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 3} -> {0: 3, 1: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 3, 2: 2+2} -> {0: 3, 1: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 3, 2: 3} -> {0: 3, 1: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 3, 1: 2+2, 2: 5} -> {0: 3, 1: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 3, 1: 2+2} -> {0: 3, 1: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 3, 1: 2+2, 2: 2+2} -> {0: 3, 1: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 3, 1: 2+2, 2: 3} -> {0: 3, 1: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 3, 1: 3, 2: 5} -> {0: 3, 1: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 3, 1: 3} -> {0: 3, 1: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s [{0: 3, 1: 3, 2: 2+2} -> {0: 3, 1: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 195s FAILED tests/test_pydantic.py::test_pydantic_create_snapshot - AssertionError... 195s FAILED tests/test_pydantic.py::test_pydantic_field_repr - AssertionError: ass... 195s FAILED tests/test_pydantic.py::test_pydantic_default_value - AssertionError: ... 195s FAILED tests/test_pydantic.py::test_pydantic_factory_method - AssertionError:... 195s FAILED tests/test_pypy.py::test_pypy - TypeError: CliRunner.__init__() got an... 195s FAILED tests/test_pytest_plugin.py::test_create - AssertionError: assert {'er... 195s FAILED tests/test_pytest_plugin.py::test_fix - AssertionError: assert {'error... 195s FAILED tests/test_pytest_plugin.py::test_update - AssertionError: assert {'er... 195s FAILED tests/test_pytest_plugin.py::test_trim - TypeError: CliRunner.__init__... 195s FAILED tests/test_pytest_plugin.py::test_multiple - AssertionError: assert {'... 195s FAILED tests/test_pytest_plugin.py::test_multiple_report - TypeError: CliRunn... 195s FAILED tests/test_pytest_plugin.py::test_black_config - TypeError: CliRunner.... 195s FAILED tests/test_pytest_plugin.py::test_disabled - TypeError: CliRunner.__in... 195s FAILED tests/test_pytest_plugin.py::test_compare - TypeError: CliRunner.__ini... 195s FAILED tests/test_pytest_plugin.py::test_assertion_error_loop - TypeError: Cl... 195s FAILED tests/test_pytest_plugin.py::test_assertion_error - TypeError: CliRunn... 195s FAILED tests/test_pytest_plugin.py::test_pytest_inlinesnapshot_auto - TypeErr... 195s FAILED tests/test_pytest_plugin.py::test_persist_unknown_external - TypeError... 195s FAILED tests/test_pytest_plugin.py::test_diff_multiple_files - TypeError: Cli... 195s FAILED tests/test_pytest_plugin.py::test_storage_dir_config[tests/snapshots] 195s 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 276s autopkgtest [04:20:24]: test autodep8-python3: [----------------------- 276s Testing with python3.12: 276s 276s Testing with python3.13: 276s 277s autopkgtest [04:20:25]: test autodep8-python3: -----------------------] 277s autopkgtest [04:20:25]: test autodep8-python3: - - - - - - - - - - results - - - - - - - - - - 277s autodep8-python3 PASS (superficial) 277s autopkgtest [04:20:25]: @@@@@@@@@@@@@@@@@@@@ summary 277s upstream-tests FAIL non-zero exit status 1 277s autodep8-python3 PASS (superficial) 292s nova [W] Skipping flock for amd64 292s Creating nova instance adt-plucky-amd64-python-inline-snapshot-20250219-041545-juju-7f2275-prod-proposed-migration-environment-15-0a49f585-6e73-49e4-80ba-346301c7b472 from image adt/ubuntu-plucky-amd64-server-20250218.img (UUID 0c5f6311-785d-4524-a0d8-db541aaf5c09)... 292s nova [W] Timed out waiting for c71ed6a9-4038-4f60-a2e7-40a3c5cd3df9 to get deleted. 292s nova [W] Skipping flock for amd64 292s Creating nova instance adt-plucky-amd64-python-inline-snapshot-20250219-041545-juju-7f2275-prod-proposed-migration-environment-15-0a49f585-6e73-49e4-80ba-346301c7b472 from image adt/ubuntu-plucky-amd64-server-20250218.img (UUID 0c5f6311-785d-4524-a0d8-db541aaf5c09)... 292s nova [W] Timed out waiting for 8330adff-7996-47b5-8e8c-ff783ee4125a to get deleted.