0s autopkgtest [19:28:03]: starting date and time: 2025-02-19 19:28:03+0000 0s autopkgtest [19:28:03]: git checkout: 325255d2 Merge branch 'pin-any-arch' into 'ubuntu/production' 0s autopkgtest [19:28:03]: host juju-7f2275-prod-proposed-migration-environment-9; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.2tdmkv64/out --timeout-copy=6000 --setup-commands 'ln -s /dev/null /etc/systemd/system/bluetooth.service; printf "http_proxy=http://squid.internal:3128\nhttps_proxy=http://squid.internal:3128\nno_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\n" >> /etc/environment' --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 -- lxd -r lxd-armhf-10.145.243.202 lxd-armhf-10.145.243.202:autopkgtest/ubuntu/plucky/armhf 52s autopkgtest [19:28:55]: testbed dpkg architecture: armhf 54s autopkgtest [19:28:57]: testbed apt version: 2.9.14ubuntu1 58s autopkgtest [19:29:01]: @@@@@@@@@@@@@@@@@@@@ test bed setup 61s autopkgtest [19:29:04]: testbed release detected to be: None 69s autopkgtest [19:29:12]: updating testbed package index (apt update) 72s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed InRelease [110 kB] 72s Get:2 http://ftpmaster.internal/ubuntu plucky InRelease [249 kB] 72s Get:3 http://ftpmaster.internal/ubuntu plucky-updates InRelease [110 kB] 72s Get:4 http://ftpmaster.internal/ubuntu plucky-security InRelease [110 kB] 72s Get:5 http://ftpmaster.internal/ubuntu plucky-proposed/restricted Sources [3120 B] 72s Get:6 http://ftpmaster.internal/ubuntu plucky-proposed/universe Sources [731 kB] 72s Get:7 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse Sources [14.5 kB] 72s Get:8 http://ftpmaster.internal/ubuntu plucky-proposed/main Sources [78.4 kB] 72s Get:9 http://ftpmaster.internal/ubuntu plucky-proposed/main armhf Packages [102 kB] 72s Get:10 http://ftpmaster.internal/ubuntu plucky-proposed/main armhf Components [4964 B] 72s Get:11 http://ftpmaster.internal/ubuntu plucky-proposed/restricted armhf Packages [760 B] 72s Get:12 http://ftpmaster.internal/ubuntu plucky-proposed/restricted armhf Components [216 B] 72s Get:13 http://ftpmaster.internal/ubuntu plucky-proposed/universe armhf Packages [645 kB] 73s Get:14 http://ftpmaster.internal/ubuntu plucky-proposed/universe armhf Components [306 kB] 73s Get:15 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse armhf Packages [3468 B] 73s Get:16 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse armhf Components [1076 B] 73s Get:17 http://ftpmaster.internal/ubuntu plucky/restricted Sources [16.3 kB] 73s Get:18 http://ftpmaster.internal/ubuntu plucky/main Sources [1382 kB] 73s Get:19 http://ftpmaster.internal/ubuntu plucky/multiverse Sources [299 kB] 73s Get:20 http://ftpmaster.internal/ubuntu plucky/universe Sources [21.0 MB] 73s Get:21 http://ftpmaster.internal/ubuntu plucky/main armhf Packages [1369 kB] 73s Get:22 http://ftpmaster.internal/ubuntu plucky/main armhf Components [402 kB] 73s Get:23 http://ftpmaster.internal/ubuntu plucky/restricted armhf Packages [2900 B] 73s Get:24 http://ftpmaster.internal/ubuntu plucky/restricted armhf Components [196 B] 73s Get:25 http://ftpmaster.internal/ubuntu plucky/universe armhf Packages [15.4 MB] 74s Get:26 http://ftpmaster.internal/ubuntu plucky/universe armhf Components [3945 kB] 74s Get:27 http://ftpmaster.internal/ubuntu plucky/multiverse armhf Packages [173 kB] 74s Get:28 http://ftpmaster.internal/ubuntu plucky/multiverse armhf Components [39.7 kB] 74s Get:29 http://ftpmaster.internal/ubuntu plucky-updates/main armhf Components [208 B] 74s Get:30 http://ftpmaster.internal/ubuntu plucky-updates/restricted armhf Components [212 B] 74s Get:31 http://ftpmaster.internal/ubuntu plucky-updates/universe armhf Components [212 B] 74s Get:32 http://ftpmaster.internal/ubuntu plucky-updates/multiverse armhf Components [212 B] 74s Get:33 http://ftpmaster.internal/ubuntu plucky-security/main armhf Components [204 B] 74s Get:34 http://ftpmaster.internal/ubuntu plucky-security/restricted armhf Components [212 B] 74s Get:35 http://ftpmaster.internal/ubuntu plucky-security/universe armhf Components [208 B] 74s Get:36 http://ftpmaster.internal/ubuntu plucky-security/multiverse armhf Components [212 B] 81s Fetched 46.5 MB in 7s (7079 kB/s) 82s Reading package lists... 88s autopkgtest [19:29:31]: upgrading testbed (apt dist-upgrade and autopurge) 90s Reading package lists... 90s Building dependency tree... 90s Reading state information... 92s Calculating upgrade...Starting pkgProblemResolver with broken count: 0 92s Starting 2 pkgProblemResolver with broken count: 0 92s Done 92s Entering ResolveByKeep 92s 93s The following packages were automatically installed and are no longer required: 93s libassuan0 libicu74 libnsl2 libpython3.12-minimal libpython3.12-stdlib 93s libunwind8 linux-headers-6.11.0-8 linux-headers-6.11.0-8-generic python3.12 93s python3.12-minimal 93s Use 'apt autoremove' to remove them. 93s The following NEW packages will be installed: 93s gcc-15-base libapt-pkg7.0 libicu76 libpython3.13-minimal 93s libpython3.13-stdlib linux-headers-6.12.0-15 linux-headers-6.12.0-15-generic 93s login.defs openssl-provider-legacy python3-bcrypt python3.13 93s python3.13-minimal 93s The following packages will be upgraded: 93s apparmor apport apport-core-dump-handler appstream apt apt-utils base-passwd 93s bash bash-completion bind9-dnsutils bind9-host bind9-libs binutils 93s binutils-arm-linux-gnueabihf binutils-common bsdextrautils bsdutils 93s btrfs-progs busybox-initramfs busybox-static ca-certificates cloud-init 93s cloud-init-base console-setup console-setup-linux coreutils cron 93s cron-daemon-common curl dash dbus dbus-bin dbus-daemon 93s dbus-session-bus-common dbus-system-bus-common dbus-user-session dhcpcd-base 93s diffutils dirmngr distro-info dmsetup dpkg dpkg-dev dracut-install e2fsprogs 93s e2fsprogs-l10n ed eject ethtool fdisk fwupd gcc-14-base gettext-base 93s gir1.2-girepository-2.0 gir1.2-glib-2.0 gir1.2-packagekitglib-1.0 gnupg 93s gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpgconf gpgsm gpgv 93s groff-base gzip htop ibverbs-providers init init-system-helpers 93s initramfs-tools initramfs-tools-bin initramfs-tools-core iproute2 iptables 93s iputils-ping iputils-tracepath keyboard-configuration keyboxd kpartx 93s krb5-locales libapparmor1 libappstream5 libapt-pkg6.0t64 libarchive13t64 93s libatomic1 libbinutils libblkid1 libblockdev-crypto3 libblockdev-fs3 93s libblockdev-loop3 libblockdev-mdraid3 libblockdev-nvme3 libblockdev-part3 93s libblockdev-swap3 libblockdev-utils3 libblockdev3 libbpf1 libc-bin libc6 93s libcap-ng0 libcom-err2 libcrypt1 libctf-nobfd0 libctf0 libcurl3t64-gnutls 93s libcurl4t64 libdbus-1-3 libdebconfclient0 libdevmapper1.02.1 libdpkg-perl 93s libedit2 libext2fs2t64 libfdisk1 libffi8 libfribidi0 libftdi1-2 libfwupd3 93s libgcc-s1 libgirepository-1.0-1 libglib2.0-0t64 libglib2.0-bin 93s libglib2.0-data libgnutls30t64 libgpg-error-l10n libgpg-error0 libgpgme11t64 93s libgssapi-krb5-2 libgstreamer1.0-0 libgudev-1.0-0 libhogweed6t64 libibverbs1 93s libicu74 libip4tc2 libip6tc2 libjson-glib-1.0-0 libjson-glib-1.0-common 93s libk5crypto3 libkrb5-3 libkrb5support0 libldap-common libldap2 liblsof0 93s liblz4-1 libmaxminddb0 libmount1 libncurses6 libncursesw6 libnetplan1 93s libnettle8t64 libnewt0.52 libnftables1 libnftnl11 libnpth0t64 libnspr4 93s libnss-systemd libnss3 libnvme1t64 libp11-kit0 libpackagekit-glib2-18 93s libpam-systemd libpcap0.8t64 libpng16-16t64 libpolkit-agent-1-0 93s libpolkit-gobject-1-0 libprotobuf-c1 libpython3-stdlib libpython3.12-minimal 93s libpython3.12-stdlib libqmi-glib5 libqmi-proxy libreadline8t64 libsasl2-2 93s libsasl2-modules libsasl2-modules-db libselinux1 libsemanage-common 93s libsemanage2 libsframe1 libsmartcols1 libss2 libssl3t64 libstdc++6 93s libsystemd-shared libsystemd0 libtasn1-6 libtinfo6 libtraceevent1 93s libtraceevent1-plugin libudev1 libudisks2-0 libunistring5 liburcu8t64 93s libusb-1.0-0 libuuid1 libvolume-key1 libwrap0 libxdmcp6 libxkbcommon0 93s libxml2 libxtables12 libxxhash0 libyaml-0-2 libzstd1 linux-headers-generic 93s locales login logsave lshw lsof make mawk mount multipath-tools nano 93s ncurses-base ncurses-bin ncurses-term netcat-openbsd netplan-generator 93s netplan.io nftables openssl packagekit packagekit-tools passwd pci.ids 93s pinentry-curses polkitd pollinate powermgmt-base psmisc publicsuffix 93s python-apt-common python-babel-localedata python3 python3-apport python3-apt 93s python3-attr python3-babel python3-certifi python3-chardet 93s python3-cryptography python3-distro-info python3-gdbm python3-gi 93s python3-idna python3-jinja2 python3-json-pointer python3-jsonpatch 93s python3-jsonschema python3-jwt python3-launchpadlib python3-lazr.uri 93s python3-minimal python3-more-itertools python3-netplan python3-newt 93s python3-oauthlib python3-openssl python3-pkg-resources 93s python3-problem-report python3-pygments python3-referencing python3-rich 93s python3-setuptools python3-software-properties python3-urllib3 93s python3-wadllib python3.12 python3.12-gdbm python3.12-minimal 93s python3.13-gdbm readline-common rsync rsyslog software-properties-common 93s systemd systemd-cryptsetup systemd-resolved systemd-sysv systemd-timesyncd 93s sysvinit-utils tar tzdata ubuntu-minimal ubuntu-standard ucf udev udisks2 93s ufw unattended-upgrades usb.ids util-linux uuid-runtime whiptail xauth 93s xfsprogs zstd 93s 300 upgraded, 12 newly installed, 0 to remove and 0 not upgraded. 93s Need to get 135 MB of archives. 93s After this operation, 198 MB of additional disk space will be used. 93s Get:1 http://ftpmaster.internal/ubuntu plucky/main armhf bash armhf 5.2.37-1ubuntu1 [677 kB] 94s Get:2 http://ftpmaster.internal/ubuntu plucky/main armhf bsdutils armhf 1:2.40.2-14ubuntu1 [110 kB] 94s Get:3 http://ftpmaster.internal/ubuntu plucky/main armhf coreutils armhf 9.5-1ubuntu1 [1275 kB] 94s Get:4 http://ftpmaster.internal/ubuntu plucky/main armhf dash armhf 0.5.12-12ubuntu1 [87.4 kB] 94s Get:5 http://ftpmaster.internal/ubuntu plucky/main armhf diffutils armhf 1:3.10-2 [172 kB] 94s Get:6 http://ftpmaster.internal/ubuntu plucky/main armhf gcc-15-base armhf 15-20250213-1ubuntu1 [53.2 kB] 94s Get:7 http://ftpmaster.internal/ubuntu plucky/main armhf libgcc-s1 armhf 15-20250213-1ubuntu1 [40.6 kB] 94s Get:8 http://ftpmaster.internal/ubuntu plucky/main armhf libc6 armhf 2.40-4ubuntu1 [2866 kB] 94s Get:9 http://ftpmaster.internal/ubuntu plucky/main armhf libxxhash0 armhf 0.8.3-2 [30.8 kB] 94s Get:10 http://ftpmaster.internal/ubuntu plucky/main armhf liblz4-1 armhf 1.10.0-3 [57.2 kB] 94s Get:11 http://ftpmaster.internal/ubuntu plucky/main armhf openssl-provider-legacy armhf 3.4.0-1ubuntu2 [29.4 kB] 94s Get:12 http://ftpmaster.internal/ubuntu plucky/main armhf libssl3t64 armhf 3.4.0-1ubuntu2 [1756 kB] 94s Get:13 http://ftpmaster.internal/ubuntu plucky/main armhf libzstd1 armhf 1.5.6+dfsg-2 [266 kB] 94s Get:14 http://ftpmaster.internal/ubuntu plucky/main armhf libstdc++6 armhf 15-20250213-1ubuntu1 [725 kB] 94s Get:15 http://ftpmaster.internal/ubuntu plucky/main armhf systemd-timesyncd armhf 257.2-3ubuntu1 [42.1 kB] 94s Get:16 http://ftpmaster.internal/ubuntu plucky/main armhf dbus-session-bus-common all 1.16.0-1ubuntu1 [53.1 kB] 94s Get:17 http://ftpmaster.internal/ubuntu plucky/main armhf systemd-sysv armhf 257.2-3ubuntu1 [11.9 kB] 94s Get:18 http://ftpmaster.internal/ubuntu plucky/main armhf libpam-systemd armhf 257.2-3ubuntu1 [238 kB] 94s Get:19 http://ftpmaster.internal/ubuntu plucky/main armhf dbus-user-session armhf 1.16.0-1ubuntu1 [9684 B] 94s Get:20 http://ftpmaster.internal/ubuntu plucky/main armhf libapparmor1 armhf 4.1.0~beta5-0ubuntu2 [48.4 kB] 94s Get:21 http://ftpmaster.internal/ubuntu plucky/main armhf libcap-ng0 armhf 0.8.5-4 [13.8 kB] 94s Get:22 http://ftpmaster.internal/ubuntu plucky/main armhf libselinux1 armhf 3.7-3ubuntu2 [73.2 kB] 94s Get:23 http://ftpmaster.internal/ubuntu plucky/main armhf dbus-system-bus-common all 1.16.0-1ubuntu1 [54.3 kB] 94s Get:24 http://ftpmaster.internal/ubuntu plucky/main armhf dbus-bin armhf 1.16.0-1ubuntu1 [37.9 kB] 94s Get:25 http://ftpmaster.internal/ubuntu plucky/main armhf dbus armhf 1.16.0-1ubuntu1 [28.1 kB] 94s Get:26 http://ftpmaster.internal/ubuntu plucky/main armhf dbus-daemon armhf 1.16.0-1ubuntu1 [111 kB] 94s Get:27 http://ftpmaster.internal/ubuntu plucky/main armhf libdbus-1-3 armhf 1.16.0-1ubuntu1 [162 kB] 94s Get:28 http://ftpmaster.internal/ubuntu plucky/main armhf systemd-resolved armhf 257.2-3ubuntu1 [315 kB] 94s Get:29 http://ftpmaster.internal/ubuntu plucky/main armhf systemd-cryptsetup armhf 257.2-3ubuntu1 [126 kB] 94s Get:30 http://ftpmaster.internal/ubuntu plucky/main armhf libncurses6 armhf 6.5+20250125-2 [88.8 kB] 94s Get:31 http://ftpmaster.internal/ubuntu plucky/main armhf libncursesw6 armhf 6.5+20250125-2 [118 kB] 94s Get:32 http://ftpmaster.internal/ubuntu plucky/main armhf libtinfo6 armhf 6.5+20250125-2 [91.9 kB] 94s Get:33 http://ftpmaster.internal/ubuntu plucky/main armhf bsdextrautils armhf 2.40.2-14ubuntu1 [94.2 kB] 94s Get:34 http://ftpmaster.internal/ubuntu plucky/main armhf eject armhf 2.40.2-14ubuntu1 [63.4 kB] 94s Get:35 http://ftpmaster.internal/ubuntu plucky/main armhf fdisk armhf 2.40.2-14ubuntu1 [157 kB] 94s Get:36 http://ftpmaster.internal/ubuntu plucky/main armhf libblkid1 armhf 2.40.2-14ubuntu1 [169 kB] 94s Get:37 http://ftpmaster.internal/ubuntu plucky/main armhf libmount1 armhf 2.40.2-14ubuntu1 [194 kB] 94s Get:38 http://ftpmaster.internal/ubuntu plucky/main armhf libsmartcols1 armhf 2.40.2-14ubuntu1 [137 kB] 94s Get:39 http://ftpmaster.internal/ubuntu plucky/main armhf libuuid1 armhf 2.40.2-14ubuntu1 [41.0 kB] 94s Get:40 http://ftpmaster.internal/ubuntu plucky/main armhf util-linux armhf 2.40.2-14ubuntu1 [1190 kB] 94s Get:41 http://ftpmaster.internal/ubuntu plucky/main armhf uuid-runtime armhf 2.40.2-14ubuntu1 [63.7 kB] 94s Get:42 http://ftpmaster.internal/ubuntu plucky/main armhf libfdisk1 armhf 2.40.2-14ubuntu1 [217 kB] 94s Get:43 http://ftpmaster.internal/ubuntu plucky/main armhf mount armhf 2.40.2-14ubuntu1 [158 kB] 94s Get:44 http://ftpmaster.internal/ubuntu plucky/main armhf readline-common all 8.2-6 [56.5 kB] 94s Get:45 http://ftpmaster.internal/ubuntu plucky/main armhf libreadline8t64 armhf 8.2-6 [131 kB] 94s Get:46 http://ftpmaster.internal/ubuntu plucky/main armhf libcrypt1 armhf 1:4.4.38-1 [91.7 kB] 94s Get:47 http://ftpmaster.internal/ubuntu plucky/main armhf libsystemd-shared armhf 257.2-3ubuntu1 [2203 kB] 94s Get:48 http://ftpmaster.internal/ubuntu plucky/main armhf systemd armhf 257.2-3ubuntu1 [3028 kB] 94s Get:49 http://ftpmaster.internal/ubuntu plucky/main armhf udev armhf 257.2-3ubuntu1 [1402 kB] 94s Get:50 http://ftpmaster.internal/ubuntu plucky/main armhf libnss-systemd armhf 257.2-3ubuntu1 [164 kB] 94s Get:51 http://ftpmaster.internal/ubuntu plucky/main armhf libudev1 armhf 257.2-3ubuntu1 [193 kB] 94s Get:52 http://ftpmaster.internal/ubuntu plucky/main armhf libsystemd0 armhf 257.2-3ubuntu1 [494 kB] 94s Get:53 http://ftpmaster.internal/ubuntu plucky/main armhf libapt-pkg6.0t64 armhf 2.9.29 [1086 kB] 94s Get:54 http://ftpmaster.internal/ubuntu plucky/main armhf tar armhf 1.35+dfsg-3.1 [240 kB] 94s Get:55 http://ftpmaster.internal/ubuntu plucky/main armhf dpkg armhf 1.22.11ubuntu4 [1242 kB] 95s Get:56 http://ftpmaster.internal/ubuntu plucky/main armhf gzip armhf 1.13-1ubuntu2 [98.1 kB] 95s Get:57 http://ftpmaster.internal/ubuntu plucky/main armhf ncurses-bin armhf 6.5+20250125-2 [179 kB] 95s Get:58 http://ftpmaster.internal/ubuntu plucky/main armhf libdebconfclient0 armhf 0.274ubuntu1 [11.2 kB] 95s Get:59 http://ftpmaster.internal/ubuntu plucky/main armhf base-passwd armhf 3.6.6 [53.4 kB] 95s Get:60 http://ftpmaster.internal/ubuntu plucky/main armhf init-system-helpers all 1.68 [39.0 kB] 95s Get:61 http://ftpmaster.internal/ubuntu plucky/main armhf libc-bin armhf 2.40-4ubuntu1 [542 kB] 95s Get:62 http://ftpmaster.internal/ubuntu plucky/main armhf ncurses-base all 6.5+20250125-2 [25.8 kB] 95s Get:63 http://ftpmaster.internal/ubuntu plucky/main armhf ncurses-term all 6.5+20250125-2 [276 kB] 95s Get:64 http://ftpmaster.internal/ubuntu plucky/main armhf console-setup-linux all 1.226ubuntu3 [1880 kB] 95s Get:65 http://ftpmaster.internal/ubuntu plucky/main armhf console-setup all 1.226ubuntu3 [110 kB] 95s Get:66 http://ftpmaster.internal/ubuntu plucky/main armhf keyboard-configuration all 1.226ubuntu3 [212 kB] 95s Get:67 http://ftpmaster.internal/ubuntu plucky/main armhf sysvinit-utils armhf 3.14-1ubuntu1 [35.1 kB] 95s Get:68 http://ftpmaster.internal/ubuntu plucky/main armhf libapt-pkg7.0 armhf 2.9.30 [1065 kB] 95s Get:69 http://ftpmaster.internal/ubuntu plucky/main armhf apt armhf 2.9.30 [1390 kB] 95s Get:70 http://ftpmaster.internal/ubuntu plucky/main armhf apt-utils armhf 2.9.30 [214 kB] 95s Get:71 http://ftpmaster.internal/ubuntu plucky/main armhf libgpg-error-l10n all 1.51-3 [8800 B] 95s Get:72 http://ftpmaster.internal/ubuntu plucky/main armhf libgpg-error0 armhf 1.51-3 [64.8 kB] 95s Get:73 http://ftpmaster.internal/ubuntu plucky/main armhf libnpth0t64 armhf 1.8-2 [7572 B] 95s Get:74 http://ftpmaster.internal/ubuntu plucky/main armhf gpg-wks-client armhf 2.4.4-2ubuntu22 [87.5 kB] 95s Get:75 http://ftpmaster.internal/ubuntu plucky/main armhf dirmngr armhf 2.4.4-2ubuntu22 [347 kB] 95s Get:76 http://ftpmaster.internal/ubuntu plucky/main armhf gpgsm armhf 2.4.4-2ubuntu22 [242 kB] 95s Get:77 http://ftpmaster.internal/ubuntu plucky/main armhf gnupg-utils armhf 2.4.4-2ubuntu22 [159 kB] 95s Get:78 http://ftpmaster.internal/ubuntu plucky/main armhf gpg-agent armhf 2.4.4-2ubuntu22 [237 kB] 95s Get:79 http://ftpmaster.internal/ubuntu plucky/main armhf gpg armhf 2.4.4-2ubuntu22 [525 kB] 95s Get:80 http://ftpmaster.internal/ubuntu plucky/main armhf gpgconf armhf 2.4.4-2ubuntu22 [116 kB] 95s Get:81 http://ftpmaster.internal/ubuntu plucky/main armhf gnupg all 2.4.4-2ubuntu22 [359 kB] 95s Get:82 http://ftpmaster.internal/ubuntu plucky/main armhf keyboxd armhf 2.4.4-2ubuntu22 [111 kB] 95s Get:83 http://ftpmaster.internal/ubuntu plucky/main armhf pinentry-curses armhf 1.3.1-2ubuntu2 [40.6 kB] 95s Get:84 http://ftpmaster.internal/ubuntu plucky/main armhf libnettle8t64 armhf 3.10.1-1 [188 kB] 95s Get:85 http://ftpmaster.internal/ubuntu plucky/main armhf libhogweed6t64 armhf 3.10.1-1 [188 kB] 95s Get:86 http://ftpmaster.internal/ubuntu plucky/main armhf libffi8 armhf 3.4.7-1 [21.1 kB] 95s Get:87 http://ftpmaster.internal/ubuntu plucky/main armhf libp11-kit0 armhf 0.25.5-2ubuntu3 [261 kB] 95s Get:88 http://ftpmaster.internal/ubuntu plucky/main armhf libtasn1-6 armhf 4.20.0-2 [38.2 kB] 95s Get:89 http://ftpmaster.internal/ubuntu plucky/main armhf libunistring5 armhf 1.3-1 [583 kB] 95s Get:90 http://ftpmaster.internal/ubuntu plucky/main armhf libgnutls30t64 armhf 3.8.9-2ubuntu1 [961 kB] 95s Get:91 http://ftpmaster.internal/ubuntu plucky/main armhf libsasl2-modules-db armhf 2.1.28+dfsg1-8build1 [19.0 kB] 95s Get:92 http://ftpmaster.internal/ubuntu plucky/main armhf libsasl2-2 armhf 2.1.28+dfsg1-8build1 [49.9 kB] 95s Get:93 http://ftpmaster.internal/ubuntu plucky/main armhf libldap-common all 2.6.9+dfsg-1~exp2ubuntu1 [33.2 kB] 95s Get:94 http://ftpmaster.internal/ubuntu plucky/main armhf libldap2 armhf 2.6.9+dfsg-1~exp2ubuntu1 [177 kB] 95s Get:95 http://ftpmaster.internal/ubuntu plucky/main armhf gpgv armhf 2.4.4-2ubuntu22 [225 kB] 95s Get:96 http://ftpmaster.internal/ubuntu plucky/main armhf e2fsprogs-l10n all 1.47.2-1ubuntu1 [7030 B] 95s Get:97 http://ftpmaster.internal/ubuntu plucky/main armhf logsave armhf 1.47.2-1ubuntu1 [25.7 kB] 95s Get:98 http://ftpmaster.internal/ubuntu plucky/main armhf ubuntu-minimal armhf 1.547 [11.4 kB] 95s Get:99 http://ftpmaster.internal/ubuntu plucky/main armhf initramfs-tools all 0.145ubuntu2 [7948 B] 95s Get:100 http://ftpmaster.internal/ubuntu plucky/main armhf initramfs-tools-core all 0.145ubuntu2 [51.5 kB] 95s Get:101 http://ftpmaster.internal/ubuntu plucky/main armhf libext2fs2t64 armhf 1.47.2-1ubuntu1 [207 kB] 95s Get:102 http://ftpmaster.internal/ubuntu plucky/main armhf e2fsprogs armhf 1.47.2-1ubuntu1 [588 kB] 96s Get:103 http://ftpmaster.internal/ubuntu plucky/main armhf dhcpcd-base armhf 1:10.1.0-7 [188 kB] 96s Get:104 http://ftpmaster.internal/ubuntu plucky/main armhf init armhf 1.68 [6296 B] 96s Get:105 http://ftpmaster.internal/ubuntu plucky/main armhf libbpf1 armhf 1:1.5.0-2 [158 kB] 96s Get:106 http://ftpmaster.internal/ubuntu plucky/main armhf iptables armhf 1.8.11-2ubuntu1 [342 kB] 96s Get:107 http://ftpmaster.internal/ubuntu plucky/main armhf libip4tc2 armhf 1.8.11-2ubuntu1 [21.7 kB] 96s Get:108 http://ftpmaster.internal/ubuntu plucky/main armhf libip6tc2 armhf 1.8.11-2ubuntu1 [22.1 kB] 96s Get:109 http://ftpmaster.internal/ubuntu plucky/main armhf libnftnl11 armhf 1.2.8-1 [53.3 kB] 96s Get:110 http://ftpmaster.internal/ubuntu plucky/main armhf libxtables12 armhf 1.8.11-2ubuntu1 [33.0 kB] 96s Get:111 http://ftpmaster.internal/ubuntu plucky/main armhf iproute2 armhf 6.13.0-1ubuntu1 [1096 kB] 96s Get:112 http://ftpmaster.internal/ubuntu plucky/main armhf iputils-ping armhf 3:20240905-1ubuntu1 [45.0 kB] 96s Get:113 http://ftpmaster.internal/ubuntu plucky/main armhf locales all 2.40-4ubuntu1 [4224 kB] 97s Get:114 http://ftpmaster.internal/ubuntu plucky/main armhf login.defs all 1:4.16.0-7ubuntu1 [38.5 kB] 97s Get:115 http://ftpmaster.internal/ubuntu plucky/main armhf login armhf 1:4.16.0-2+really2.40.2-14ubuntu1 [85.0 kB] 97s Get:116 http://ftpmaster.internal/ubuntu plucky/main armhf mawk armhf 1.3.4.20250131-1 [119 kB] 97s Get:117 http://ftpmaster.internal/ubuntu plucky/main armhf netcat-openbsd armhf 1.228-1 [42.4 kB] 97s Get:118 http://ftpmaster.internal/ubuntu plucky/main armhf libpython3.13-minimal armhf 3.13.2-1 [868 kB] 97s Get:119 http://ftpmaster.internal/ubuntu plucky/main armhf python3.13-minimal armhf 3.13.2-1 [2012 kB] 97s Get:120 http://ftpmaster.internal/ubuntu plucky/main armhf python3-cryptography armhf 43.0.0-1 [925 kB] 97s Get:121 http://ftpmaster.internal/ubuntu plucky/main armhf python3-minimal armhf 3.13.1-1~exp2 [27.6 kB] 97s Get:122 http://ftpmaster.internal/ubuntu plucky/main armhf python3 armhf 3.13.1-1~exp2 [23.9 kB] 97s Get:123 http://ftpmaster.internal/ubuntu plucky/main armhf python3-bcrypt armhf 4.2.0-2.1 [239 kB] 97s Get:124 http://ftpmaster.internal/ubuntu plucky/main armhf tzdata all 2025a-2ubuntu1 [198 kB] 97s Get:125 http://ftpmaster.internal/ubuntu plucky/main armhf libpython3.13-stdlib armhf 3.13.2-1 [1969 kB] 97s Get:126 http://ftpmaster.internal/ubuntu plucky/main armhf python3.13 armhf 3.13.2-1 [734 kB] 97s Get:127 http://ftpmaster.internal/ubuntu plucky/main armhf libpython3-stdlib armhf 3.13.1-1~exp2 [10.2 kB] 97s Get:128 http://ftpmaster.internal/ubuntu plucky/main armhf gir1.2-girepository-2.0 armhf 1.82.0-4 [25.3 kB] 97s Get:129 http://ftpmaster.internal/ubuntu plucky/main armhf gir1.2-glib-2.0 armhf 2.83.3-2 [184 kB] 97s Get:130 http://ftpmaster.internal/ubuntu plucky/main armhf libgirepository-1.0-1 armhf 1.82.0-4 [109 kB] 97s Get:131 http://ftpmaster.internal/ubuntu plucky/main armhf libglib2.0-data all 2.83.3-2 [52.7 kB] 97s Get:132 http://ftpmaster.internal/ubuntu plucky/main armhf libglib2.0-bin armhf 2.83.3-2 [92.7 kB] 97s Get:133 http://ftpmaster.internal/ubuntu plucky/main armhf libatomic1 armhf 15-20250213-1ubuntu1 [7938 B] 97s Get:134 http://ftpmaster.internal/ubuntu plucky/main armhf libglib2.0-0t64 armhf 2.83.3-2 [1452 kB] 98s Get:135 http://ftpmaster.internal/ubuntu plucky/main armhf netplan-generator armhf 1.1.2-2ubuntu1 [60.8 kB] 98s Get:136 http://ftpmaster.internal/ubuntu plucky/main armhf libyaml-0-2 armhf 0.2.5-2 [45.3 kB] 98s Get:137 http://ftpmaster.internal/ubuntu plucky/main armhf python3-netplan armhf 1.1.2-2ubuntu1 [24.2 kB] 98s Get:138 http://ftpmaster.internal/ubuntu plucky/main armhf netplan.io armhf 1.1.2-2ubuntu1 [67.7 kB] 98s Get:139 http://ftpmaster.internal/ubuntu plucky/main armhf libnetplan1 armhf 1.1.2-2ubuntu1 [123 kB] 98s Get:140 http://ftpmaster.internal/ubuntu plucky/main armhf ethtool armhf 1:6.11-1 [222 kB] 98s Get:141 http://ftpmaster.internal/ubuntu plucky/main armhf libsemanage-common all 3.7-2.1 [7198 B] 98s Get:142 http://ftpmaster.internal/ubuntu plucky/main armhf libsemanage2 armhf 3.7-2.1 [85.4 kB] 98s Get:143 http://ftpmaster.internal/ubuntu plucky/main armhf passwd armhf 1:4.16.0-7ubuntu1 [1041 kB] 98s Get:144 http://ftpmaster.internal/ubuntu plucky/main armhf python3-newt armhf 0.52.24-4ubuntu1 [20.1 kB] 98s Get:145 http://ftpmaster.internal/ubuntu plucky/main armhf libnewt0.52 armhf 0.52.24-4ubuntu1 [39.7 kB] 98s Get:146 http://ftpmaster.internal/ubuntu plucky/main armhf whiptail armhf 0.52.24-4ubuntu1 [17.3 kB] 98s Get:147 http://ftpmaster.internal/ubuntu plucky/main armhf dracut-install armhf 106-2ubuntu1 [38.7 kB] 98s Get:148 http://ftpmaster.internal/ubuntu plucky/main armhf initramfs-tools-bin armhf 0.145ubuntu2 [24.5 kB] 98s Get:149 http://ftpmaster.internal/ubuntu plucky/main armhf busybox-initramfs armhf 1:1.37.0-4ubuntu1 [188 kB] 98s Get:150 http://ftpmaster.internal/ubuntu plucky/main armhf python3.12 armhf 3.12.9-1 [671 kB] 98s Get:151 http://ftpmaster.internal/ubuntu plucky/main armhf libpython3.12-stdlib armhf 3.12.9-1 [1946 kB] 98s Get:152 http://ftpmaster.internal/ubuntu plucky/main armhf python3.12-minimal armhf 3.12.9-1 [2012 kB] 98s Get:153 http://ftpmaster.internal/ubuntu plucky/main armhf libpython3.12-minimal armhf 3.12.9-1 [825 kB] 98s Get:154 http://ftpmaster.internal/ubuntu plucky/main armhf cron armhf 3.0pl1-192ubuntu1 [84.2 kB] 98s Get:155 http://ftpmaster.internal/ubuntu plucky/main armhf rsync armhf 3.4.1-0syncable1 [422 kB] 98s Get:156 http://ftpmaster.internal/ubuntu plucky/main armhf python-apt-common all 2.9.9 [21.2 kB] 98s Get:157 http://ftpmaster.internal/ubuntu plucky/main armhf python3-apt armhf 2.9.9 [173 kB] 98s Get:158 http://ftpmaster.internal/ubuntu plucky/main armhf python3-lazr.uri all 1.0.6-5 [13.6 kB] 98s Get:159 http://ftpmaster.internal/ubuntu plucky/main armhf python3-launchpadlib all 2.1.0-1 [126 kB] 98s Get:160 http://ftpmaster.internal/ubuntu plucky/main armhf python3-problem-report all 2.31.0-0ubuntu5 [25.5 kB] 98s Get:161 http://ftpmaster.internal/ubuntu plucky/main armhf python3-apport all 2.31.0-0ubuntu5 [93.1 kB] 98s Get:162 http://ftpmaster.internal/ubuntu plucky/main armhf python3-gi armhf 3.50.0-4 [260 kB] 98s Get:163 http://ftpmaster.internal/ubuntu plucky/main armhf apport-core-dump-handler all 2.31.0-0ubuntu5 [18.4 kB] 98s Get:164 http://ftpmaster.internal/ubuntu plucky/main armhf apport all 2.31.0-0ubuntu5 [83.0 kB] 98s Get:165 http://ftpmaster.internal/ubuntu plucky/main armhf gcc-14-base armhf 14.2.0-17ubuntu1 [53.5 kB] 98s Get:166 http://ftpmaster.internal/ubuntu plucky/main armhf libcom-err2 armhf 1.47.2-1ubuntu1 [25.6 kB] 98s Get:167 http://ftpmaster.internal/ubuntu plucky/main armhf libss2 armhf 1.47.2-1ubuntu1 [15.6 kB] 98s Get:168 http://ftpmaster.internal/ubuntu plucky/main armhf openssl armhf 3.4.0-1ubuntu2 [1159 kB] 98s Get:169 http://ftpmaster.internal/ubuntu plucky/main armhf ca-certificates all 20241223 [165 kB] 98s Get:170 http://ftpmaster.internal/ubuntu plucky/main armhf distro-info armhf 1.13 [19.1 kB] 98s Get:171 http://ftpmaster.internal/ubuntu plucky/main armhf krb5-locales all 1.21.3-4ubuntu1 [14.7 kB] 98s Get:172 http://ftpmaster.internal/ubuntu plucky/main armhf libfribidi0 armhf 1.0.16-1 [24.3 kB] 98s Get:173 http://ftpmaster.internal/ubuntu plucky/main armhf libgssapi-krb5-2 armhf 1.21.3-4ubuntu1 [121 kB] 98s Get:174 http://ftpmaster.internal/ubuntu plucky/main armhf libkrb5-3 armhf 1.21.3-4ubuntu1 [314 kB] 98s Get:175 http://ftpmaster.internal/ubuntu plucky/main armhf libkrb5support0 armhf 1.21.3-4ubuntu1 [31.8 kB] 98s Get:176 http://ftpmaster.internal/ubuntu plucky/main armhf libk5crypto3 armhf 1.21.3-4ubuntu1 [78.6 kB] 98s Get:177 http://ftpmaster.internal/ubuntu plucky/main armhf libicu74 armhf 74.2-1ubuntu6 [10.5 MB] 99s Get:178 http://ftpmaster.internal/ubuntu plucky/main armhf libxml2 armhf 2.12.7+dfsg+really2.9.14-0.2ubuntu3 [599 kB] 99s Get:179 http://ftpmaster.internal/ubuntu plucky/main armhf python3-pygments all 2.18.0+dfsg-2 [835 kB] 99s Get:180 http://ftpmaster.internal/ubuntu plucky/main armhf python3-rich all 13.9.4-1 [190 kB] 99s Get:181 http://ftpmaster.internal/ubuntu plucky/main armhf ucf all 3.0049 [43.3 kB] 99s Get:182 http://ftpmaster.internal/ubuntu plucky/main armhf rsyslog armhf 8.2412.0-2ubuntu1 [471 kB] 99s Get:183 http://ftpmaster.internal/ubuntu plucky/main armhf apparmor armhf 4.1.0~beta5-0ubuntu2 [606 kB] 99s Get:184 http://ftpmaster.internal/ubuntu plucky/main armhf bash-completion all 1:2.16.0-7 [214 kB] 99s Get:185 http://ftpmaster.internal/ubuntu plucky/main armhf libmaxminddb0 armhf 1.12.2-1 [16.9 kB] 99s Get:186 http://ftpmaster.internal/ubuntu plucky/main armhf liburcu8t64 armhf 0.15.1-1 [57.1 kB] 99s Get:187 http://ftpmaster.internal/ubuntu plucky/main armhf bind9-dnsutils armhf 1:9.20.0-2ubuntu4 [155 kB] 99s Get:188 http://ftpmaster.internal/ubuntu plucky/main armhf bind9-host armhf 1:9.20.0-2ubuntu4 [46.2 kB] 99s Get:189 http://ftpmaster.internal/ubuntu plucky/main armhf bind9-libs armhf 1:9.20.0-2ubuntu4 [1176 kB] 99s Get:190 http://ftpmaster.internal/ubuntu plucky/main armhf libedit2 armhf 3.1-20250104-1 [79.3 kB] 99s Get:191 http://ftpmaster.internal/ubuntu plucky/main armhf busybox-static armhf 1:1.37.0-4ubuntu1 [857 kB] 99s Get:192 http://ftpmaster.internal/ubuntu plucky/main armhf cron-daemon-common all 3.0pl1-192ubuntu1 [14.5 kB] 99s Get:193 http://ftpmaster.internal/ubuntu plucky/main armhf libdevmapper1.02.1 armhf 2:1.02.201-1ubuntu1 [137 kB] 99s Get:194 http://ftpmaster.internal/ubuntu plucky/main armhf dmsetup armhf 2:1.02.201-1ubuntu1 [80.4 kB] 99s Get:195 http://ftpmaster.internal/ubuntu plucky/main armhf ed armhf 1.21-1 [52.8 kB] 99s Get:196 http://ftpmaster.internal/ubuntu plucky/main armhf gettext-base armhf 0.23.1-1 [43.3 kB] 99s Get:197 http://ftpmaster.internal/ubuntu plucky/main armhf groff-base armhf 1.23.0-7 [949 kB] 99s Get:198 http://ftpmaster.internal/ubuntu plucky/main armhf libibverbs1 armhf 55.0-1ubuntu1 [58.5 kB] 99s Get:199 http://ftpmaster.internal/ubuntu plucky/main armhf ibverbs-providers armhf 55.0-1ubuntu1 [27.6 kB] 99s Get:200 http://ftpmaster.internal/ubuntu plucky/main armhf iputils-tracepath armhf 3:20240905-1ubuntu1 [13.3 kB] 99s Get:201 http://ftpmaster.internal/ubuntu plucky/main armhf nftables armhf 1.1.1-1build1 [70.8 kB] 99s Get:202 http://ftpmaster.internal/ubuntu plucky/main armhf libnftables1 armhf 1.1.1-1build1 [321 kB] 99s Get:203 http://ftpmaster.internal/ubuntu plucky/main armhf libpcap0.8t64 armhf 1.10.5-2ubuntu1 [140 kB] 100s Get:204 http://ftpmaster.internal/ubuntu plucky/main armhf libpng16-16t64 armhf 1.6.46-4 [171 kB] 100s Get:205 http://ftpmaster.internal/ubuntu plucky/main armhf libtraceevent1-plugin armhf 1:1.8.4-2 [19.0 kB] 100s Get:206 http://ftpmaster.internal/ubuntu plucky/main armhf libtraceevent1 armhf 1:1.8.4-2 [53.8 kB] 100s Get:207 http://ftpmaster.internal/ubuntu plucky/main armhf libusb-1.0-0 armhf 2:1.0.27-2 [49.5 kB] 100s Get:208 http://ftpmaster.internal/ubuntu plucky/main armhf libxdmcp6 armhf 1:1.1.5-1 [9060 B] 100s Get:209 http://ftpmaster.internal/ubuntu plucky/main armhf libxkbcommon0 armhf 1.7.0-2 [113 kB] 100s Get:210 http://ftpmaster.internal/ubuntu plucky/main armhf lshw armhf 02.19.git.2021.06.19.996aaad9c7-2.1ubuntu1 [311 kB] 100s Get:211 http://ftpmaster.internal/ubuntu plucky/main armhf lsof armhf 4.99.4+dfsg-1 [239 kB] 100s Get:212 http://ftpmaster.internal/ubuntu plucky/main armhf liblsof0 armhf 4.99.4+dfsg-1 [60.7 kB] 100s Get:213 http://ftpmaster.internal/ubuntu plucky/main armhf nano armhf 8.3-1 [277 kB] 100s Get:214 http://ftpmaster.internal/ubuntu plucky/main armhf pci.ids all 0.0~2025.02.12-1 [284 kB] 100s Get:215 http://ftpmaster.internal/ubuntu plucky/main armhf powermgmt-base all 1.38 [7378 B] 100s Get:216 http://ftpmaster.internal/ubuntu plucky/main armhf psmisc armhf 23.7-2 [177 kB] 100s Get:217 http://ftpmaster.internal/ubuntu plucky/main armhf publicsuffix all 20250108.1153-0.1 [134 kB] 100s Get:218 http://ftpmaster.internal/ubuntu plucky/main armhf python3-distro-info all 1.13 [7798 B] 100s Get:219 http://ftpmaster.internal/ubuntu plucky/main armhf python3.13-gdbm armhf 3.13.2-1 [30.2 kB] 100s Get:220 http://ftpmaster.internal/ubuntu plucky/main armhf python3.12-gdbm armhf 3.12.9-1 [29.3 kB] 100s Get:221 http://ftpmaster.internal/ubuntu plucky/main armhf python3-gdbm armhf 3.13.1-1 [8668 B] 100s Get:222 http://ftpmaster.internal/ubuntu plucky/main armhf ubuntu-standard armhf 1.547 [11.4 kB] 100s Get:223 http://ftpmaster.internal/ubuntu plucky/main armhf ufw all 0.36.2-9 [170 kB] 100s Get:224 http://ftpmaster.internal/ubuntu plucky/main armhf usb.ids all 2025.01.14-1 [223 kB] 100s Get:225 http://ftpmaster.internal/ubuntu plucky/main armhf xauth armhf 1:1.1.2-1.1 [23.0 kB] 100s Get:226 http://ftpmaster.internal/ubuntu plucky/main armhf libcurl3t64-gnutls armhf 8.12.0+git20250209.89ed161+ds-1ubuntu1 [330 kB] 100s Get:227 http://ftpmaster.internal/ubuntu plucky/main armhf libappstream5 armhf 1.0.4-1 [211 kB] 100s Get:228 http://ftpmaster.internal/ubuntu plucky/main armhf appstream armhf 1.0.4-1 [67.3 kB] 100s Get:229 http://ftpmaster.internal/ubuntu plucky/main armhf libctf0 armhf 2.44-1ubuntu1 [74.4 kB] 100s Get:230 http://ftpmaster.internal/ubuntu plucky/main armhf libctf-nobfd0 armhf 2.44-1ubuntu1 [77.6 kB] 100s Get:231 http://ftpmaster.internal/ubuntu plucky/main armhf binutils-arm-linux-gnueabihf armhf 2.44-1ubuntu1 [995 kB] 100s Get:232 http://ftpmaster.internal/ubuntu plucky/main armhf libbinutils armhf 2.44-1ubuntu1 [405 kB] 100s Get:233 http://ftpmaster.internal/ubuntu plucky/main armhf binutils armhf 2.44-1ubuntu1 [3238 B] 100s Get:234 http://ftpmaster.internal/ubuntu plucky/main armhf binutils-common armhf 2.44-1ubuntu1 [216 kB] 100s Get:235 http://ftpmaster.internal/ubuntu plucky/main armhf libsframe1 armhf 2.44-1ubuntu1 [12.5 kB] 100s Get:236 http://ftpmaster.internal/ubuntu plucky/main armhf btrfs-progs armhf 6.12-1build1 [884 kB] 100s Get:237 http://ftpmaster.internal/ubuntu plucky/main armhf python3-jinja2 all 3.1.5-2 [109 kB] 100s Get:238 http://ftpmaster.internal/ubuntu plucky/main armhf python3-json-pointer all 2.4-3 [8444 B] 100s Get:239 http://ftpmaster.internal/ubuntu plucky/main armhf python3-jsonpatch all 1.32-5 [12.3 kB] 100s Get:240 http://ftpmaster.internal/ubuntu plucky/main armhf python3-attr all 25.1.0-1 [50.4 kB] 100s Get:241 http://ftpmaster.internal/ubuntu plucky/main armhf python3-referencing all 0.35.1-2ubuntu1 [21.9 kB] 100s Get:242 http://ftpmaster.internal/ubuntu plucky/main armhf python3-jsonschema all 4.19.2-6ubuntu1 [65.5 kB] 100s Get:243 http://ftpmaster.internal/ubuntu plucky/main armhf python3-jwt all 2.10.1-2 [21.0 kB] 100s Get:244 http://ftpmaster.internal/ubuntu plucky/main armhf python3-oauthlib all 3.2.2-3 [89.9 kB] 100s Get:245 http://ftpmaster.internal/ubuntu plucky/main armhf cloud-init-base all 25.1~3geb1965a4-0ubuntu1 [615 kB] 100s Get:246 http://ftpmaster.internal/ubuntu plucky/main armhf curl armhf 8.12.0+git20250209.89ed161+ds-1ubuntu1 [247 kB] 100s Get:247 http://ftpmaster.internal/ubuntu plucky/main armhf libcurl4t64 armhf 8.12.0+git20250209.89ed161+ds-1ubuntu1 [335 kB] 100s Get:248 http://ftpmaster.internal/ubuntu plucky/main armhf dpkg-dev all 1.22.11ubuntu4 [1088 kB] 100s Get:249 http://ftpmaster.internal/ubuntu plucky/main armhf libdpkg-perl all 1.22.11ubuntu4 [279 kB] 100s Get:250 http://ftpmaster.internal/ubuntu plucky/main armhf make armhf 4.4.1-1 [180 kB] 100s Get:251 http://ftpmaster.internal/ubuntu plucky/main armhf libarchive13t64 armhf 3.7.7-0ubuntu1 [335 kB] 100s Get:252 http://ftpmaster.internal/ubuntu plucky/main armhf libjson-glib-1.0-common all 1.10.6+ds-1 [5636 B] 100s Get:253 http://ftpmaster.internal/ubuntu plucky/main armhf libjson-glib-1.0-0 armhf 1.10.6+ds-1 [59.5 kB] 100s Get:254 http://ftpmaster.internal/ubuntu plucky/main armhf fwupd armhf 2.0.5-1 [5151 kB] 102s Get:255 http://ftpmaster.internal/ubuntu plucky/main armhf libfwupd3 armhf 2.0.5-1 [125 kB] 102s Get:256 http://ftpmaster.internal/ubuntu plucky/main armhf polkitd armhf 126-2 [92.5 kB] 102s Get:257 http://ftpmaster.internal/ubuntu plucky/main armhf libpolkit-agent-1-0 armhf 126-2 [15.1 kB] 102s Get:258 http://ftpmaster.internal/ubuntu plucky/main armhf libpolkit-gobject-1-0 armhf 126-2 [45.0 kB] 102s Get:259 http://ftpmaster.internal/ubuntu plucky/main armhf libprotobuf-c1 armhf 1.5.1-1ubuntu1 [18.1 kB] 102s Get:260 http://ftpmaster.internal/ubuntu plucky/main armhf libqmi-proxy armhf 1.35.6-1 [5878 B] 102s Get:261 http://ftpmaster.internal/ubuntu plucky/main armhf libqmi-glib5 armhf 1.35.6-1 [928 kB] 102s Get:262 http://ftpmaster.internal/ubuntu plucky/main armhf libpackagekit-glib2-18 armhf 1.3.0-3build1 [109 kB] 102s Get:263 http://ftpmaster.internal/ubuntu plucky/main armhf gir1.2-packagekitglib-1.0 armhf 1.3.0-3build1 [25.5 kB] 102s Get:264 http://ftpmaster.internal/ubuntu plucky/main armhf gnupg-l10n all 2.4.4-2ubuntu22 [66.4 kB] 102s Get:265 http://ftpmaster.internal/ubuntu plucky/main armhf htop armhf 3.3.0-5 [140 kB] 102s Get:266 http://ftpmaster.internal/ubuntu plucky/main armhf libblockdev-utils3 armhf 3.3.0-1 [17.5 kB] 102s Get:267 http://ftpmaster.internal/ubuntu plucky/main armhf libnspr4 armhf 2:4.36-1ubuntu1 [94.5 kB] 102s Get:268 http://ftpmaster.internal/ubuntu plucky/main armhf libnss3 armhf 2:3.107-1ubuntu1 [1315 kB] 102s Get:269 http://ftpmaster.internal/ubuntu plucky/main armhf libgpgme11t64 armhf 1.24.2-1ubuntu1 [125 kB] 102s Get:270 http://ftpmaster.internal/ubuntu plucky/main armhf libvolume-key1 armhf 0.3.12-9 [39.1 kB] 102s Get:271 http://ftpmaster.internal/ubuntu plucky/main armhf libblockdev-crypto3 armhf 3.3.0-1 [22.4 kB] 102s Get:272 http://ftpmaster.internal/ubuntu plucky/main armhf libblockdev-fs3 armhf 3.3.0-1 [34.5 kB] 102s Get:273 http://ftpmaster.internal/ubuntu plucky/main armhf libblockdev-loop3 armhf 3.3.0-1 [6594 B] 102s Get:274 http://ftpmaster.internal/ubuntu plucky/main armhf libblockdev-mdraid3 armhf 3.3.0-1 [13.4 kB] 102s Get:275 http://ftpmaster.internal/ubuntu plucky/main armhf libnvme1t64 armhf 1.11.1-2 [73.6 kB] 102s Get:276 http://ftpmaster.internal/ubuntu plucky/main armhf libblockdev-nvme3 armhf 3.3.0-1 [17.7 kB] 102s Get:277 http://ftpmaster.internal/ubuntu plucky/main armhf libblockdev-part3 armhf 3.3.0-1 [16.6 kB] 102s Get:278 http://ftpmaster.internal/ubuntu plucky/main armhf libblockdev-swap3 armhf 3.3.0-1 [9010 B] 102s Get:279 http://ftpmaster.internal/ubuntu plucky/main armhf libblockdev3 armhf 3.3.0-1 [44.4 kB] 102s Get:280 http://ftpmaster.internal/ubuntu plucky/main armhf libftdi1-2 armhf 1.5-8 [26.3 kB] 102s Get:281 http://ftpmaster.internal/ubuntu plucky/main armhf libgstreamer1.0-0 armhf 1.25.50-1 [1164 kB] 102s Get:282 http://ftpmaster.internal/ubuntu plucky/main armhf libgudev-1.0-0 armhf 1:238-6 [13.7 kB] 102s Get:283 http://ftpmaster.internal/ubuntu plucky/main armhf libicu76 armhf 76.1-1ubuntu2 [10.8 MB] 102s Get:284 http://ftpmaster.internal/ubuntu plucky/main armhf libsasl2-modules armhf 2.1.28+dfsg1-8build1 [62.7 kB] 102s Get:285 http://ftpmaster.internal/ubuntu plucky/main armhf udisks2 armhf 2.10.1-11ubuntu2 [278 kB] 102s Get:286 http://ftpmaster.internal/ubuntu plucky/main armhf libudisks2-0 armhf 2.10.1-11ubuntu2 [142 kB] 102s Get:287 http://ftpmaster.internal/ubuntu plucky/main armhf libwrap0 armhf 7.6.q-35 [45.6 kB] 102s Get:288 http://ftpmaster.internal/ubuntu plucky/main armhf linux-headers-6.12.0-15 all 6.12.0-15.15 [14.1 MB] 102s Get:289 http://ftpmaster.internal/ubuntu plucky/main armhf linux-headers-6.12.0-15-generic armhf 6.12.0-15.15 [1414 kB] 102s Get:290 http://ftpmaster.internal/ubuntu plucky/main armhf linux-headers-generic armhf 6.12.0-15.15+1 [10.8 kB] 102s Get:291 http://ftpmaster.internal/ubuntu plucky/main armhf packagekit-tools armhf 1.3.0-3build1 [28.0 kB] 102s Get:292 http://ftpmaster.internal/ubuntu plucky/main armhf packagekit armhf 1.3.0-3build1 [431 kB] 102s Get:293 http://ftpmaster.internal/ubuntu plucky/main armhf pollinate all 4.33-4ubuntu2 [12.4 kB] 102s Get:294 http://ftpmaster.internal/ubuntu plucky/main armhf python3-babel all 2.17.0-1 [101 kB] 102s Get:295 http://ftpmaster.internal/ubuntu plucky/main armhf python-babel-localedata all 2.17.0-1 [6678 kB] 102s Get:296 http://ftpmaster.internal/ubuntu plucky/main armhf python3-certifi all 2025.1.31+ds-1 [9816 B] 102s Get:297 http://ftpmaster.internal/ubuntu plucky/main armhf python3-chardet all 5.2.0+dfsg-2 [116 kB] 102s Get:298 http://ftpmaster.internal/ubuntu plucky/main armhf python3-idna all 3.10-1 [47.4 kB] 102s Get:299 http://ftpmaster.internal/ubuntu plucky/main armhf python3-more-itertools all 10.6.0-1 [57.7 kB] 102s Get:300 http://ftpmaster.internal/ubuntu plucky/main armhf python3-openssl all 25.0.0-1 [46.1 kB] 102s Get:301 http://ftpmaster.internal/ubuntu plucky/main armhf python3-pkg-resources all 75.6.0-1 [144 kB] 102s Get:302 http://ftpmaster.internal/ubuntu plucky/main armhf python3-setuptools all 75.6.0-1 [645 kB] 102s Get:303 http://ftpmaster.internal/ubuntu plucky/main armhf software-properties-common all 0.108 [16.5 kB] 102s Get:304 http://ftpmaster.internal/ubuntu plucky/main armhf python3-software-properties all 0.108 [30.9 kB] 103s Get:305 http://ftpmaster.internal/ubuntu plucky/main armhf python3-urllib3 all 2.3.0-1 [94.0 kB] 103s Get:306 http://ftpmaster.internal/ubuntu plucky/main armhf python3-wadllib all 2.0.0-2 [36.2 kB] 103s Get:307 http://ftpmaster.internal/ubuntu plucky/main armhf unattended-upgrades all 2.12ubuntu3 [58.4 kB] 103s Get:308 http://ftpmaster.internal/ubuntu plucky/main armhf xfsprogs armhf 6.12.0-1ubuntu1 [958 kB] 103s Get:309 http://ftpmaster.internal/ubuntu plucky/main armhf zstd armhf 1.5.6+dfsg-2 [690 kB] 103s Get:310 http://ftpmaster.internal/ubuntu plucky/main armhf cloud-init all 25.1~3geb1965a4-0ubuntu1 [2102 B] 103s Get:311 http://ftpmaster.internal/ubuntu plucky/main armhf kpartx armhf 0.9.9-1ubuntu4 [35.0 kB] 103s Get:312 http://ftpmaster.internal/ubuntu plucky/main armhf multipath-tools armhf 0.9.9-1ubuntu4 [294 kB] 104s Preconfiguring packages ... 105s Fetched 135 MB in 10s (13.6 MB/s) 105s (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 ... 59970 files and directories currently installed.) 105s Preparing to unpack .../bash_5.2.37-1ubuntu1_armhf.deb ... 105s Unpacking bash (5.2.37-1ubuntu1) over (5.2.32-1ubuntu2) ... 105s Setting up bash (5.2.37-1ubuntu1) ... 105s update-alternatives: using /usr/share/man/man7/bash-builtins.7.gz to provide /usr/share/man/man7/builtins.7.gz (builtins.7.gz) in auto mode 105s (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 ... 59970 files and directories currently installed.) 105s Preparing to unpack .../bsdutils_1%3a2.40.2-14ubuntu1_armhf.deb ... 105s Unpacking bsdutils (1:2.40.2-14ubuntu1) over (1:2.40.2-1ubuntu1) ... 105s Setting up bsdutils (1:2.40.2-14ubuntu1) ... 105s (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 ... 59970 files and directories currently installed.) 105s Preparing to unpack .../coreutils_9.5-1ubuntu1_armhf.deb ... 105s Unpacking coreutils (9.5-1ubuntu1) over (9.4-3.1ubuntu1) ... 106s Setting up coreutils (9.5-1ubuntu1) ... 106s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 59970 files and directories currently installed.) 106s Preparing to unpack .../dash_0.5.12-12ubuntu1_armhf.deb ... 106s Unpacking dash (0.5.12-12ubuntu1) over (0.5.12-9ubuntu1) ... 106s Setting up dash (0.5.12-12ubuntu1) ... 106s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 59970 files and directories currently installed.) 106s Preparing to unpack .../diffutils_1%3a3.10-2_armhf.deb ... 106s Unpacking diffutils (1:3.10-2) over (1:3.10-1build1) ... 106s Setting up diffutils (1:3.10-2) ... 106s Selecting previously unselected package gcc-15-base:armhf. 106s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 59970 files and directories currently installed.) 106s Preparing to unpack .../gcc-15-base_15-20250213-1ubuntu1_armhf.deb ... 106s Unpacking gcc-15-base:armhf (15-20250213-1ubuntu1) ... 106s Setting up gcc-15-base:armhf (15-20250213-1ubuntu1) ... 106s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 59975 files and directories currently installed.) 106s Preparing to unpack .../libgcc-s1_15-20250213-1ubuntu1_armhf.deb ... 106s Unpacking libgcc-s1:armhf (15-20250213-1ubuntu1) over (14.2.0-8ubuntu1) ... 106s Setting up libgcc-s1:armhf (15-20250213-1ubuntu1) ... 106s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 59975 files and directories currently installed.) 106s Preparing to unpack .../libc6_2.40-4ubuntu1_armhf.deb ... 106s Unpacking libc6:armhf (2.40-4ubuntu1) over (2.40-1ubuntu3) ... 106s Setting up libc6:armhf (2.40-4ubuntu1) ... 106s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 59975 files and directories currently installed.) 106s Preparing to unpack .../libxxhash0_0.8.3-2_armhf.deb ... 106s Unpacking libxxhash0:armhf (0.8.3-2) over (0.8.2-2build1) ... 107s Setting up libxxhash0:armhf (0.8.3-2) ... 107s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 59975 files and directories currently installed.) 107s Preparing to unpack .../liblz4-1_1.10.0-3_armhf.deb ... 107s Unpacking liblz4-1:armhf (1.10.0-3) over (1.9.4-3) ... 107s Setting up liblz4-1:armhf (1.10.0-3) ... 107s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 59975 files and directories currently installed.) 107s Preparing to unpack .../libssl3t64_3.4.0-1ubuntu2_armhf.deb ... 107s Unpacking libssl3t64:armhf (3.4.0-1ubuntu2) over (3.3.1-2ubuntu2) ... 107s Selecting previously unselected package openssl-provider-legacy. 107s Preparing to unpack .../openssl-provider-legacy_3.4.0-1ubuntu2_armhf.deb ... 107s Unpacking openssl-provider-legacy (3.4.0-1ubuntu2) ... 107s Setting up libssl3t64:armhf (3.4.0-1ubuntu2) ... 107s Setting up openssl-provider-legacy (3.4.0-1ubuntu2) ... 107s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 59978 files and directories currently installed.) 107s Preparing to unpack .../libzstd1_1.5.6+dfsg-2_armhf.deb ... 107s Unpacking libzstd1:armhf (1.5.6+dfsg-2) over (1.5.6+dfsg-1) ... 107s Setting up libzstd1:armhf (1.5.6+dfsg-2) ... 107s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 59978 files and directories currently installed.) 107s Preparing to unpack .../libstdc++6_15-20250213-1ubuntu1_armhf.deb ... 107s Unpacking libstdc++6:armhf (15-20250213-1ubuntu1) over (14.2.0-8ubuntu1) ... 107s Setting up libstdc++6:armhf (15-20250213-1ubuntu1) ... 107s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 59978 files and directories currently installed.) 107s Preparing to unpack .../0-systemd-timesyncd_257.2-3ubuntu1_armhf.deb ... 107s Unpacking systemd-timesyncd (257.2-3ubuntu1) over (256.5-2ubuntu4) ... 107s Preparing to unpack .../1-dbus-session-bus-common_1.16.0-1ubuntu1_all.deb ... 107s Unpacking dbus-session-bus-common (1.16.0-1ubuntu1) over (1.14.10-4ubuntu5) ... 107s Preparing to unpack .../2-systemd-sysv_257.2-3ubuntu1_armhf.deb ... 107s Unpacking systemd-sysv (257.2-3ubuntu1) over (256.5-2ubuntu4) ... 107s Preparing to unpack .../3-libpam-systemd_257.2-3ubuntu1_armhf.deb ... 107s Unpacking libpam-systemd:armhf (257.2-3ubuntu1) over (256.5-2ubuntu4) ... 107s Preparing to unpack .../4-dbus-user-session_1.16.0-1ubuntu1_armhf.deb ... 107s Unpacking dbus-user-session (1.16.0-1ubuntu1) over (1.14.10-4ubuntu5) ... 107s Preparing to unpack .../5-libapparmor1_4.1.0~beta5-0ubuntu2_armhf.deb ... 107s Unpacking libapparmor1:armhf (4.1.0~beta5-0ubuntu2) over (4.1.0~beta1-0ubuntu4) ... 107s Preparing to unpack .../6-libcap-ng0_0.8.5-4_armhf.deb ... 107s Unpacking libcap-ng0:armhf (0.8.5-4) over (0.8.5-3build1) ... 107s Setting up libcap-ng0:armhf (0.8.5-4) ... 107s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 59979 files and directories currently installed.) 107s Preparing to unpack .../libselinux1_3.7-3ubuntu2_armhf.deb ... 107s Unpacking libselinux1:armhf (3.7-3ubuntu2) over (3.7-3ubuntu1) ... 107s Setting up libselinux1:armhf (3.7-3ubuntu2) ... 108s (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 ... 59979 files and directories currently installed.) 108s Preparing to unpack .../0-dbus-system-bus-common_1.16.0-1ubuntu1_all.deb ... 108s Unpacking dbus-system-bus-common (1.16.0-1ubuntu1) over (1.14.10-4ubuntu5) ... 108s Preparing to unpack .../1-dbus-bin_1.16.0-1ubuntu1_armhf.deb ... 108s Unpacking dbus-bin (1.16.0-1ubuntu1) over (1.14.10-4ubuntu5) ... 108s Preparing to unpack .../2-dbus_1.16.0-1ubuntu1_armhf.deb ... 108s Unpacking dbus (1.16.0-1ubuntu1) over (1.14.10-4ubuntu5) ... 108s Preparing to unpack .../3-dbus-daemon_1.16.0-1ubuntu1_armhf.deb ... 108s Unpacking dbus-daemon (1.16.0-1ubuntu1) over (1.14.10-4ubuntu5) ... 108s Preparing to unpack .../4-libdbus-1-3_1.16.0-1ubuntu1_armhf.deb ... 108s Unpacking libdbus-1-3:armhf (1.16.0-1ubuntu1) over (1.14.10-4ubuntu5) ... 108s Preparing to unpack .../5-systemd-resolved_257.2-3ubuntu1_armhf.deb ... 108s Unpacking systemd-resolved (257.2-3ubuntu1) over (256.5-2ubuntu4) ... 108s Preparing to unpack .../6-systemd-cryptsetup_257.2-3ubuntu1_armhf.deb ... 108s Unpacking systemd-cryptsetup (257.2-3ubuntu1) over (256.5-2ubuntu4) ... 108s Preparing to unpack .../7-libncurses6_6.5+20250125-2_armhf.deb ... 108s Unpacking libncurses6:armhf (6.5+20250125-2) over (6.5-2) ... 108s Preparing to unpack .../8-libncursesw6_6.5+20250125-2_armhf.deb ... 108s Unpacking libncursesw6:armhf (6.5+20250125-2) over (6.5-2) ... 108s Preparing to unpack .../9-libtinfo6_6.5+20250125-2_armhf.deb ... 108s Unpacking libtinfo6:armhf (6.5+20250125-2) over (6.5-2) ... 108s Setting up libtinfo6:armhf (6.5+20250125-2) ... 108s (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 ... 59979 files and directories currently installed.) 108s Preparing to unpack .../bsdextrautils_2.40.2-14ubuntu1_armhf.deb ... 108s Unpacking bsdextrautils (2.40.2-14ubuntu1) over (2.40.2-1ubuntu1) ... 108s Preparing to unpack .../eject_2.40.2-14ubuntu1_armhf.deb ... 108s Unpacking eject (2.40.2-14ubuntu1) over (2.40.2-1ubuntu1) ... 108s Preparing to unpack .../fdisk_2.40.2-14ubuntu1_armhf.deb ... 108s Unpacking fdisk (2.40.2-14ubuntu1) over (2.40.2-1ubuntu1) ... 108s Preparing to unpack .../libblkid1_2.40.2-14ubuntu1_armhf.deb ... 108s Unpacking libblkid1:armhf (2.40.2-14ubuntu1) over (2.40.2-1ubuntu1) ... 108s Setting up libblkid1:armhf (2.40.2-14ubuntu1) ... 108s (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 ... 59975 files and directories currently installed.) 108s Preparing to unpack .../libmount1_2.40.2-14ubuntu1_armhf.deb ... 108s Unpacking libmount1:armhf (2.40.2-14ubuntu1) over (2.40.2-1ubuntu1) ... 108s Setting up libmount1:armhf (2.40.2-14ubuntu1) ... 108s (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 ... 59975 files and directories currently installed.) 108s Preparing to unpack .../libsmartcols1_2.40.2-14ubuntu1_armhf.deb ... 108s Unpacking libsmartcols1:armhf (2.40.2-14ubuntu1) over (2.40.2-1ubuntu1) ... 108s Setting up libsmartcols1:armhf (2.40.2-14ubuntu1) ... 108s (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 ... 59975 files and directories currently installed.) 108s Preparing to unpack .../libuuid1_2.40.2-14ubuntu1_armhf.deb ... 108s Unpacking libuuid1:armhf (2.40.2-14ubuntu1) over (2.40.2-1ubuntu1) ... 108s Setting up libuuid1:armhf (2.40.2-14ubuntu1) ... 108s (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 ... 59975 files and directories currently installed.) 108s Preparing to unpack .../util-linux_2.40.2-14ubuntu1_armhf.deb ... 109s Unpacking util-linux (2.40.2-14ubuntu1) over (2.40.2-1ubuntu1) ... 109s Setting up util-linux (2.40.2-14ubuntu1) ... 109s fstrim.service is a disabled or a static unit not running, not starting it. 109s (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 ... 59968 files and directories currently installed.) 109s Preparing to unpack .../0-uuid-runtime_2.40.2-14ubuntu1_armhf.deb ... 109s Unpacking uuid-runtime (2.40.2-14ubuntu1) over (2.40.2-1ubuntu1) ... 110s Preparing to unpack .../1-libfdisk1_2.40.2-14ubuntu1_armhf.deb ... 110s Unpacking libfdisk1:armhf (2.40.2-14ubuntu1) over (2.40.2-1ubuntu1) ... 110s Preparing to unpack .../2-mount_2.40.2-14ubuntu1_armhf.deb ... 110s Unpacking mount (2.40.2-14ubuntu1) over (2.40.2-1ubuntu1) ... 110s Preparing to unpack .../3-readline-common_8.2-6_all.deb ... 110s Unpacking readline-common (8.2-6) over (8.2-5) ... 110s Preparing to unpack .../4-libreadline8t64_8.2-6_armhf.deb ... 110s Leaving 'diversion of /lib/arm-linux-gnueabihf/libhistory.so.8 to /lib/arm-linux-gnueabihf/libhistory.so.8.usr-is-merged by libreadline8t64' 110s Leaving 'diversion of /lib/arm-linux-gnueabihf/libhistory.so.8.2 to /lib/arm-linux-gnueabihf/libhistory.so.8.2.usr-is-merged by libreadline8t64' 110s Leaving 'diversion of /lib/arm-linux-gnueabihf/libreadline.so.8 to /lib/arm-linux-gnueabihf/libreadline.so.8.usr-is-merged by libreadline8t64' 110s Leaving 'diversion of /lib/arm-linux-gnueabihf/libreadline.so.8.2 to /lib/arm-linux-gnueabihf/libreadline.so.8.2.usr-is-merged by libreadline8t64' 110s Unpacking libreadline8t64:armhf (8.2-6) over (8.2-5) ... 110s Preparing to unpack .../5-libcrypt1_1%3a4.4.38-1_armhf.deb ... 110s Unpacking libcrypt1:armhf (1:4.4.38-1) over (1:4.4.36-5) ... 110s Setting up libcrypt1:armhf (1:4.4.38-1) ... 110s (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 ... 59968 files and directories currently installed.) 110s Preparing to unpack .../libsystemd-shared_257.2-3ubuntu1_armhf.deb ... 110s Unpacking libsystemd-shared:armhf (257.2-3ubuntu1) over (256.5-2ubuntu4) ... 110s Setting up libsystemd-shared:armhf (257.2-3ubuntu1) ... 110s (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 ... 59968 files and directories currently installed.) 110s Preparing to unpack .../systemd_257.2-3ubuntu1_armhf.deb ... 110s Unpacking systemd (257.2-3ubuntu1) over (256.5-2ubuntu4) ... 110s Preparing to unpack .../udev_257.2-3ubuntu1_armhf.deb ... 110s Unpacking udev (257.2-3ubuntu1) over (256.5-2ubuntu4) ... 110s Preparing to unpack .../libnss-systemd_257.2-3ubuntu1_armhf.deb ... 110s Unpacking libnss-systemd:armhf (257.2-3ubuntu1) over (256.5-2ubuntu4) ... 110s Preparing to unpack .../libudev1_257.2-3ubuntu1_armhf.deb ... 110s Unpacking libudev1:armhf (257.2-3ubuntu1) over (256.5-2ubuntu4) ... 110s Setting up libudev1:armhf (257.2-3ubuntu1) ... 111s (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 ... 59962 files and directories currently installed.) 111s Preparing to unpack .../libsystemd0_257.2-3ubuntu1_armhf.deb ... 111s Unpacking libsystemd0:armhf (257.2-3ubuntu1) over (256.5-2ubuntu4) ... 111s Setting up libsystemd0:armhf (257.2-3ubuntu1) ... 111s (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 ... 59962 files and directories currently installed.) 111s Preparing to unpack .../libapt-pkg6.0t64_2.9.29_armhf.deb ... 111s Unpacking libapt-pkg6.0t64:armhf (2.9.29) over (2.9.14ubuntu1) ... 111s Setting up libapt-pkg6.0t64:armhf (2.9.29) ... 111s (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 ... 59962 files and directories currently installed.) 111s Preparing to unpack .../tar_1.35+dfsg-3.1_armhf.deb ... 111s Unpacking tar (1.35+dfsg-3.1) over (1.35+dfsg-3build1) ... 111s Setting up tar (1.35+dfsg-3.1) ... 111s (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 ... 59962 files and directories currently installed.) 111s Preparing to unpack .../dpkg_1.22.11ubuntu4_armhf.deb ... 111s Unpacking dpkg (1.22.11ubuntu4) over (1.22.11ubuntu3) ... 111s Setting up dpkg (1.22.11ubuntu4) ... 111s (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 ... 59962 files and directories currently installed.) 111s Preparing to unpack .../gzip_1.13-1ubuntu2_armhf.deb ... 111s Unpacking gzip (1.13-1ubuntu2) over (1.12-1.1ubuntu1) ... 112s Setting up gzip (1.13-1ubuntu2) ... 112s (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 ... 59962 files and directories currently installed.) 112s Preparing to unpack .../ncurses-bin_6.5+20250125-2_armhf.deb ... 112s Unpacking ncurses-bin (6.5+20250125-2) over (6.5-2) ... 112s Setting up ncurses-bin (6.5+20250125-2) ... 112s (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 ... 59962 files and directories currently installed.) 112s Preparing to unpack .../libdebconfclient0_0.274ubuntu1_armhf.deb ... 112s Unpacking libdebconfclient0:armhf (0.274ubuntu1) over (0.272ubuntu1) ... 112s Setting up libdebconfclient0:armhf (0.274ubuntu1) ... 112s (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 ... 59962 files and directories currently installed.) 112s Preparing to unpack .../base-passwd_3.6.6_armhf.deb ... 112s Unpacking base-passwd (3.6.6) over (3.6.5) ... 112s Setting up base-passwd (3.6.6) ... 112s (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 ... 59962 files and directories currently installed.) 112s Preparing to unpack .../init-system-helpers_1.68_all.deb ... 112s Unpacking init-system-helpers (1.68) over (1.67ubuntu1) ... 112s Setting up init-system-helpers (1.68) ... 112s (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 ... 59962 files and directories currently installed.) 112s Preparing to unpack .../libc-bin_2.40-4ubuntu1_armhf.deb ... 112s Unpacking libc-bin (2.40-4ubuntu1) over (2.40-1ubuntu3) ... 112s Setting up libc-bin (2.40-4ubuntu1) ... 112s (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 ... 59962 files and directories currently installed.) 112s Preparing to unpack .../ncurses-base_6.5+20250125-2_all.deb ... 112s Unpacking ncurses-base (6.5+20250125-2) over (6.5-2) ... 113s Setting up ncurses-base (6.5+20250125-2) ... 113s (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 ... 59962 files and directories currently installed.) 113s Preparing to unpack .../ncurses-term_6.5+20250125-2_all.deb ... 113s Unpacking ncurses-term (6.5+20250125-2) over (6.5-2) ... 113s Preparing to unpack .../console-setup-linux_1.226ubuntu3_all.deb ... 113s Unpacking console-setup-linux (1.226ubuntu3) over (1.226ubuntu2) ... 113s Preparing to unpack .../console-setup_1.226ubuntu3_all.deb ... 113s Unpacking console-setup (1.226ubuntu3) over (1.226ubuntu2) ... 113s Preparing to unpack .../keyboard-configuration_1.226ubuntu3_all.deb ... 113s Unpacking keyboard-configuration (1.226ubuntu3) over (1.226ubuntu2) ... 113s Preparing to unpack .../sysvinit-utils_3.14-1ubuntu1_armhf.deb ... 113s Unpacking sysvinit-utils (3.14-1ubuntu1) over (3.08-6ubuntu3) ... 114s Setting up sysvinit-utils (3.14-1ubuntu1) ... 114s Selecting previously unselected package libapt-pkg7.0:armhf. 114s (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 ... 59970 files and directories currently installed.) 114s Preparing to unpack .../libapt-pkg7.0_2.9.30_armhf.deb ... 114s Unpacking libapt-pkg7.0:armhf (2.9.30) ... 114s Setting up libapt-pkg7.0:armhf (2.9.30) ... 114s (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 ... 60019 files and directories currently installed.) 114s Preparing to unpack .../archives/apt_2.9.30_armhf.deb ... 114s Unpacking apt (2.9.30) over (2.9.14ubuntu1) ... 114s Setting up apt (2.9.30) ... 115s (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 ... 60021 files and directories currently installed.) 115s Preparing to unpack .../apt-utils_2.9.30_armhf.deb ... 115s Unpacking apt-utils (2.9.30) over (2.9.14ubuntu1) ... 115s Preparing to unpack .../libgpg-error-l10n_1.51-3_all.deb ... 115s Unpacking libgpg-error-l10n (1.51-3) over (1.50-4) ... 115s Preparing to unpack .../libgpg-error0_1.51-3_armhf.deb ... 115s Unpacking libgpg-error0:armhf (1.51-3) over (1.50-4) ... 115s Setting up libgpg-error0:armhf (1.51-3) ... 115s (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 ... 60021 files and directories currently installed.) 115s Preparing to unpack .../libnpth0t64_1.8-2_armhf.deb ... 115s Unpacking libnpth0t64:armhf (1.8-2) over (1.6-3.1build1) ... 115s Setting up libnpth0t64:armhf (1.8-2) ... 115s (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 ... 60021 files and directories currently installed.) 115s Preparing to unpack .../00-gpg-wks-client_2.4.4-2ubuntu22_armhf.deb ... 115s Unpacking gpg-wks-client (2.4.4-2ubuntu22) over (2.4.4-2ubuntu18) ... 115s Preparing to unpack .../01-dirmngr_2.4.4-2ubuntu22_armhf.deb ... 115s Unpacking dirmngr (2.4.4-2ubuntu22) over (2.4.4-2ubuntu18) ... 115s Preparing to unpack .../02-gpgsm_2.4.4-2ubuntu22_armhf.deb ... 115s Unpacking gpgsm (2.4.4-2ubuntu22) over (2.4.4-2ubuntu18) ... 115s Preparing to unpack .../03-gnupg-utils_2.4.4-2ubuntu22_armhf.deb ... 115s Unpacking gnupg-utils (2.4.4-2ubuntu22) over (2.4.4-2ubuntu18) ... 115s Preparing to unpack .../04-gpg-agent_2.4.4-2ubuntu22_armhf.deb ... 115s Unpacking gpg-agent (2.4.4-2ubuntu22) over (2.4.4-2ubuntu18) ... 115s Preparing to unpack .../05-gpg_2.4.4-2ubuntu22_armhf.deb ... 115s Unpacking gpg (2.4.4-2ubuntu22) over (2.4.4-2ubuntu18) ... 115s Preparing to unpack .../06-gpgconf_2.4.4-2ubuntu22_armhf.deb ... 115s Unpacking gpgconf (2.4.4-2ubuntu22) over (2.4.4-2ubuntu18) ... 115s Preparing to unpack .../07-gnupg_2.4.4-2ubuntu22_all.deb ... 115s Unpacking gnupg (2.4.4-2ubuntu22) over (2.4.4-2ubuntu18) ... 115s Preparing to unpack .../08-keyboxd_2.4.4-2ubuntu22_armhf.deb ... 115s Unpacking keyboxd (2.4.4-2ubuntu22) over (2.4.4-2ubuntu18) ... 115s Preparing to unpack .../09-pinentry-curses_1.3.1-2ubuntu2_armhf.deb ... 115s Unpacking pinentry-curses (1.3.1-2ubuntu2) over (1.3.1-0ubuntu2) ... 115s Preparing to unpack .../10-libnettle8t64_3.10.1-1_armhf.deb ... 115s Unpacking libnettle8t64:armhf (3.10.1-1) over (3.10-1) ... 115s Setting up libnettle8t64:armhf (3.10.1-1) ... 115s (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 ... 60021 files and directories currently installed.) 115s Preparing to unpack .../libhogweed6t64_3.10.1-1_armhf.deb ... 115s Unpacking libhogweed6t64:armhf (3.10.1-1) over (3.10-1) ... 115s Setting up libhogweed6t64:armhf (3.10.1-1) ... 116s (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 ... 60021 files and directories currently installed.) 116s Preparing to unpack .../libffi8_3.4.7-1_armhf.deb ... 116s Unpacking libffi8:armhf (3.4.7-1) over (3.4.6-1build1) ... 116s Setting up libffi8:armhf (3.4.7-1) ... 116s (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 ... 60021 files and directories currently installed.) 116s Preparing to unpack .../libp11-kit0_0.25.5-2ubuntu3_armhf.deb ... 116s Unpacking libp11-kit0:armhf (0.25.5-2ubuntu3) over (0.25.5-2ubuntu1) ... 116s Setting up libp11-kit0:armhf (0.25.5-2ubuntu3) ... 116s (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 ... 60021 files and directories currently installed.) 116s Preparing to unpack .../libtasn1-6_4.20.0-2_armhf.deb ... 116s Unpacking libtasn1-6:armhf (4.20.0-2) over (4.19.0-3build1) ... 116s Setting up libtasn1-6:armhf (4.20.0-2) ... 116s (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 ... 60021 files and directories currently installed.) 116s Preparing to unpack .../libunistring5_1.3-1_armhf.deb ... 116s Unpacking libunistring5:armhf (1.3-1) over (1.2-1) ... 116s Setting up libunistring5:armhf (1.3-1) ... 116s (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 ... 60021 files and directories currently installed.) 116s Preparing to unpack .../libgnutls30t64_3.8.9-2ubuntu1_armhf.deb ... 116s Unpacking libgnutls30t64:armhf (3.8.9-2ubuntu1) over (3.8.8-2ubuntu1) ... 116s Setting up libgnutls30t64:armhf (3.8.9-2ubuntu1) ... 116s (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 ... 60021 files and directories currently installed.) 116s Preparing to unpack .../libsasl2-modules-db_2.1.28+dfsg1-8build1_armhf.deb ... 116s Unpacking libsasl2-modules-db:armhf (2.1.28+dfsg1-8build1) over (2.1.28+dfsg1-8) ... 116s Preparing to unpack .../libsasl2-2_2.1.28+dfsg1-8build1_armhf.deb ... 116s Unpacking libsasl2-2:armhf (2.1.28+dfsg1-8build1) over (2.1.28+dfsg1-8) ... 116s Preparing to unpack .../libldap-common_2.6.9+dfsg-1~exp2ubuntu1_all.deb ... 116s Unpacking libldap-common (2.6.9+dfsg-1~exp2ubuntu1) over (2.6.8+dfsg-1~exp4ubuntu3) ... 116s Preparing to unpack .../libldap2_2.6.9+dfsg-1~exp2ubuntu1_armhf.deb ... 116s Unpacking libldap2:armhf (2.6.9+dfsg-1~exp2ubuntu1) over (2.6.8+dfsg-1~exp4ubuntu3) ... 116s Preparing to unpack .../gpgv_2.4.4-2ubuntu22_armhf.deb ... 116s Unpacking gpgv (2.4.4-2ubuntu22) over (2.4.4-2ubuntu18) ... 116s Setting up gpgv (2.4.4-2ubuntu22) ... 116s (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 ... 60020 files and directories currently installed.) 116s Preparing to unpack .../0-e2fsprogs-l10n_1.47.2-1ubuntu1_all.deb ... 116s Unpacking e2fsprogs-l10n (1.47.2-1ubuntu1) over (1.47.1-1ubuntu1) ... 116s Preparing to unpack .../1-logsave_1.47.2-1ubuntu1_armhf.deb ... 116s Unpacking logsave (1.47.2-1ubuntu1) over (1.47.1-1ubuntu1) ... 116s Preparing to unpack .../2-ubuntu-minimal_1.547_armhf.deb ... 116s Unpacking ubuntu-minimal (1.547) over (1.544) ... 116s Preparing to unpack .../3-initramfs-tools_0.145ubuntu2_all.deb ... 116s Unpacking initramfs-tools (0.145ubuntu2) over (0.142ubuntu35) ... 116s Preparing to unpack .../4-initramfs-tools-core_0.145ubuntu2_all.deb ... 116s Unpacking initramfs-tools-core (0.145ubuntu2) over (0.142ubuntu35) ... 117s Preparing to unpack .../5-libext2fs2t64_1.47.2-1ubuntu1_armhf.deb ... 117s Leaving 'diversion of /lib/arm-linux-gnueabihf/libe2p.so.2 to /lib/arm-linux-gnueabihf/libe2p.so.2.usr-is-merged by libext2fs2t64' 117s Leaving 'diversion of /lib/arm-linux-gnueabihf/libe2p.so.2.3 to /lib/arm-linux-gnueabihf/libe2p.so.2.3.usr-is-merged by libext2fs2t64' 117s Leaving 'diversion of /lib/arm-linux-gnueabihf/libext2fs.so.2 to /lib/arm-linux-gnueabihf/libext2fs.so.2.usr-is-merged by libext2fs2t64' 117s Leaving 'diversion of /lib/arm-linux-gnueabihf/libext2fs.so.2.4 to /lib/arm-linux-gnueabihf/libext2fs.so.2.4.usr-is-merged by libext2fs2t64' 117s Unpacking libext2fs2t64:armhf (1.47.2-1ubuntu1) over (1.47.1-1ubuntu1) ... 117s Setting up libext2fs2t64:armhf (1.47.2-1ubuntu1) ... 117s (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 ... 60020 files and directories currently installed.) 117s Preparing to unpack .../e2fsprogs_1.47.2-1ubuntu1_armhf.deb ... 117s Unpacking e2fsprogs (1.47.2-1ubuntu1) over (1.47.1-1ubuntu1) ... 117s Preparing to unpack .../dhcpcd-base_1%3a10.1.0-7_armhf.deb ... 117s Unpacking dhcpcd-base (1:10.1.0-7) over (1:10.1.0-2) ... 117s Setting up libapparmor1:armhf (4.1.0~beta5-0ubuntu2) ... 117s Setting up mount (2.40.2-14ubuntu1) ... 117s Setting up systemd (257.2-3ubuntu1) ... 117s Installing new version of config file /etc/systemd/logind.conf ... 117s Installing new version of config file /etc/systemd/sleep.conf ... 117s /usr/lib/tmpfiles.d/legacy.conf:14: Duplicate line for path "/run/lock", ignoring. 117s Created symlink '/run/systemd/system/tmp.mount' → '/dev/null'. 117s /usr/lib/tmpfiles.d/legacy.conf:14: Duplicate line for path "/run/lock", ignoring. 118s Setting up systemd-sysv (257.2-3ubuntu1) ... 118s (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 ... 60019 files and directories currently installed.) 118s Preparing to unpack .../00-init_1.68_armhf.deb ... 118s Unpacking init (1.68) over (1.67ubuntu1) ... 118s Preparing to unpack .../01-libbpf1_1%3a1.5.0-2_armhf.deb ... 118s Unpacking libbpf1:armhf (1:1.5.0-2) over (1:1.5.0-1) ... 118s Preparing to unpack .../02-iptables_1.8.11-2ubuntu1_armhf.deb ... 118s Unpacking iptables (1.8.11-2ubuntu1) over (1.8.10-3ubuntu2) ... 118s Preparing to unpack .../03-libip4tc2_1.8.11-2ubuntu1_armhf.deb ... 118s Unpacking libip4tc2:armhf (1.8.11-2ubuntu1) over (1.8.10-3ubuntu2) ... 118s Preparing to unpack .../04-libip6tc2_1.8.11-2ubuntu1_armhf.deb ... 118s Unpacking libip6tc2:armhf (1.8.11-2ubuntu1) over (1.8.10-3ubuntu2) ... 118s Preparing to unpack .../05-libnftnl11_1.2.8-1_armhf.deb ... 118s Unpacking libnftnl11:armhf (1.2.8-1) over (1.2.7-1) ... 118s Preparing to unpack .../06-libxtables12_1.8.11-2ubuntu1_armhf.deb ... 118s Unpacking libxtables12:armhf (1.8.11-2ubuntu1) over (1.8.10-3ubuntu2) ... 118s Preparing to unpack .../07-iproute2_6.13.0-1ubuntu1_armhf.deb ... 118s Unpacking iproute2 (6.13.0-1ubuntu1) over (6.10.0-2ubuntu1) ... 118s Preparing to unpack .../08-iputils-ping_3%3a20240905-1ubuntu1_armhf.deb ... 118s Unpacking iputils-ping (3:20240905-1ubuntu1) over (3:20240117-1build1) ... 118s Preparing to unpack .../09-locales_2.40-4ubuntu1_all.deb ... 118s Unpacking locales (2.40-4ubuntu1) over (2.40-1ubuntu3) ... 119s Selecting previously unselected package login.defs. 119s Preparing to unpack .../10-login.defs_1%3a4.16.0-7ubuntu1_all.deb ... 119s Unpacking login.defs (1:4.16.0-7ubuntu1) ... 119s Replacing files in old package login (1:4.15.3-3ubuntu2) ... 119s Setting up login.defs (1:4.16.0-7ubuntu1) ... 119s Installing new version of config file /etc/login.defs ... 119s (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 ... 60026 files and directories currently installed.) 119s Preparing to unpack .../0-login_1%3a4.16.0-2+really2.40.2-14ubuntu1_armhf.deb ... 119s Unpacking login (1:4.16.0-2+really2.40.2-14ubuntu1) over (1:4.15.3-3ubuntu2) ... 119s Preparing to unpack .../1-mawk_1.3.4.20250131-1_armhf.deb ... 119s Unpacking mawk (1.3.4.20250131-1) over (1.3.4.20240905-1) ... 119s Preparing to unpack .../2-netcat-openbsd_1.228-1_armhf.deb ... 119s Unpacking netcat-openbsd (1.228-1) over (1.226-1.1) ... 119s Selecting previously unselected package libpython3.13-minimal:armhf. 119s Preparing to unpack .../3-libpython3.13-minimal_3.13.2-1_armhf.deb ... 119s Unpacking libpython3.13-minimal:armhf (3.13.2-1) ... 119s Selecting previously unselected package python3.13-minimal. 119s Preparing to unpack .../4-python3.13-minimal_3.13.2-1_armhf.deb ... 119s Unpacking python3.13-minimal (3.13.2-1) ... 119s Preparing to unpack .../5-python3-cryptography_43.0.0-1_armhf.deb ... 119s Unpacking python3-cryptography (43.0.0-1) over (42.0.5-2build1) ... 119s Setting up libpython3.13-minimal:armhf (3.13.2-1) ... 119s Setting up python3.13-minimal (3.13.2-1) ... 120s (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 ... 60308 files and directories currently installed.) 120s Preparing to unpack .../python3-minimal_3.13.1-1~exp2_armhf.deb ... 120s Unpacking python3-minimal (3.13.1-1~exp2) over (3.12.6-0ubuntu1) ... 120s Setting up python3-minimal (3.13.1-1~exp2) ... 120s (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 ... 60308 files and directories currently installed.) 120s Preparing to unpack .../00-python3_3.13.1-1~exp2_armhf.deb ... 122s Unpacking python3 (3.13.1-1~exp2) over (3.12.6-0ubuntu1) ... 122s Selecting previously unselected package python3-bcrypt. 122s Preparing to unpack .../01-python3-bcrypt_4.2.0-2.1_armhf.deb ... 122s Unpacking python3-bcrypt (4.2.0-2.1) ... 122s Preparing to unpack .../02-tzdata_2025a-2ubuntu1_all.deb ... 122s Unpacking tzdata (2025a-2ubuntu1) over (2024b-1ubuntu2) ... 122s Selecting previously unselected package libpython3.13-stdlib:armhf. 122s Preparing to unpack .../03-libpython3.13-stdlib_3.13.2-1_armhf.deb ... 122s Unpacking libpython3.13-stdlib:armhf (3.13.2-1) ... 122s Selecting previously unselected package python3.13. 122s Preparing to unpack .../04-python3.13_3.13.2-1_armhf.deb ... 122s Unpacking python3.13 (3.13.2-1) ... 122s Preparing to unpack .../05-libpython3-stdlib_3.13.1-1~exp2_armhf.deb ... 122s Unpacking libpython3-stdlib:armhf (3.13.1-1~exp2) over (3.12.6-0ubuntu1) ... 122s Preparing to unpack .../06-gir1.2-girepository-2.0_1.82.0-4_armhf.deb ... 122s Unpacking gir1.2-girepository-2.0:armhf (1.82.0-4) over (1.82.0-2) ... 122s Preparing to unpack .../07-gir1.2-glib-2.0_2.83.3-2_armhf.deb ... 122s Unpacking gir1.2-glib-2.0:armhf (2.83.3-2) over (2.82.2-3) ... 122s Preparing to unpack .../08-libgirepository-1.0-1_1.82.0-4_armhf.deb ... 122s Unpacking libgirepository-1.0-1:armhf (1.82.0-4) over (1.82.0-2) ... 122s Preparing to unpack .../09-libglib2.0-data_2.83.3-2_all.deb ... 122s Unpacking libglib2.0-data (2.83.3-2) over (2.82.2-3) ... 122s Preparing to unpack .../10-libglib2.0-bin_2.83.3-2_armhf.deb ... 122s Unpacking libglib2.0-bin (2.83.3-2) over (2.82.2-3) ... 122s Preparing to unpack .../11-libatomic1_15-20250213-1ubuntu1_armhf.deb ... 122s Unpacking libatomic1:armhf (15-20250213-1ubuntu1) over (14.2.0-8ubuntu1) ... 122s Preparing to unpack .../12-libglib2.0-0t64_2.83.3-2_armhf.deb ... 122s Unpacking libglib2.0-0t64:armhf (2.83.3-2) over (2.82.2-3) ... 122s Preparing to unpack .../13-netplan-generator_1.1.2-2ubuntu1_armhf.deb ... 122s Adding 'diversion of /lib/systemd/system-generators/netplan to /lib/systemd/system-generators/netplan.usr-is-merged by netplan-generator' 122s Unpacking netplan-generator (1.1.2-2ubuntu1) over (1.1.1-1) ... 122s Preparing to unpack .../14-libyaml-0-2_0.2.5-2_armhf.deb ... 122s Unpacking libyaml-0-2:armhf (0.2.5-2) over (0.2.5-1build1) ... 122s Preparing to unpack .../15-python3-netplan_1.1.2-2ubuntu1_armhf.deb ... 122s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 122s for fn in glob1(directory, "%s.*" % fname): 122s Unpacking python3-netplan (1.1.2-2ubuntu1) over (1.1.1-1) ... 122s Preparing to unpack .../16-netplan.io_1.1.2-2ubuntu1_armhf.deb ... 122s Unpacking netplan.io (1.1.2-2ubuntu1) over (1.1.1-1) ... 122s Preparing to unpack .../17-libnetplan1_1.1.2-2ubuntu1_armhf.deb ... 122s Unpacking libnetplan1:armhf (1.1.2-2ubuntu1) over (1.1.1-1) ... 122s Preparing to unpack .../18-ethtool_1%3a6.11-1_armhf.deb ... 122s Unpacking ethtool (1:6.11-1) over (1:6.10-1) ... 122s Preparing to unpack .../19-libsemanage-common_3.7-2.1_all.deb ... 122s Unpacking libsemanage-common (3.7-2.1) over (3.7-2build1) ... 122s Setting up libsemanage-common (3.7-2.1) ... 122s (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 ... 60731 files and directories currently installed.) 122s Preparing to unpack .../libsemanage2_3.7-2.1_armhf.deb ... 122s Unpacking libsemanage2:armhf (3.7-2.1) over (3.7-2build1) ... 122s Setting up libsemanage2:armhf (3.7-2.1) ... 122s (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 ... 60731 files and directories currently installed.) 122s Preparing to unpack .../passwd_1%3a4.16.0-7ubuntu1_armhf.deb ... 122s Unpacking passwd (1:4.16.0-7ubuntu1) over (1:4.15.3-3ubuntu2) ... 122s Setting up passwd (1:4.16.0-7ubuntu1) ... 122s (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 ... 60766 files and directories currently installed.) 122s Preparing to unpack .../000-python3-newt_0.52.24-4ubuntu1_armhf.deb ... 122s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 122s for fn in glob1(directory, "%s.*" % fname): 122s Unpacking python3-newt:armhf (0.52.24-4ubuntu1) over (0.52.24-2ubuntu4) ... 122s Preparing to unpack .../001-libnewt0.52_0.52.24-4ubuntu1_armhf.deb ... 122s Unpacking libnewt0.52:armhf (0.52.24-4ubuntu1) over (0.52.24-2ubuntu4) ... 122s Preparing to unpack .../002-whiptail_0.52.24-4ubuntu1_armhf.deb ... 122s Unpacking whiptail (0.52.24-4ubuntu1) over (0.52.24-2ubuntu4) ... 122s Preparing to unpack .../003-dracut-install_106-2ubuntu1_armhf.deb ... 122s Unpacking dracut-install (106-2ubuntu1) over (105-2ubuntu3) ... 122s Preparing to unpack .../004-initramfs-tools-bin_0.145ubuntu2_armhf.deb ... 122s Unpacking initramfs-tools-bin (0.145ubuntu2) over (0.142ubuntu35) ... 122s Preparing to unpack .../005-busybox-initramfs_1%3a1.37.0-4ubuntu1_armhf.deb ... 122s Unpacking busybox-initramfs (1:1.37.0-4ubuntu1) over (1:1.36.1-9ubuntu1) ... 122s Preparing to unpack .../006-python3.12_3.12.9-1_armhf.deb ... 122s Unpacking python3.12 (3.12.9-1) over (3.12.7-3) ... 123s Preparing to unpack .../007-libpython3.12-stdlib_3.12.9-1_armhf.deb ... 123s Unpacking libpython3.12-stdlib:armhf (3.12.9-1) over (3.12.7-3) ... 123s Preparing to unpack .../008-python3.12-minimal_3.12.9-1_armhf.deb ... 123s Unpacking python3.12-minimal (3.12.9-1) over (3.12.7-3) ... 123s Preparing to unpack .../009-libpython3.12-minimal_3.12.9-1_armhf.deb ... 123s Unpacking libpython3.12-minimal:armhf (3.12.9-1) over (3.12.7-3) ... 123s Preparing to unpack .../010-cron_3.0pl1-192ubuntu1_armhf.deb ... 123s Unpacking cron (3.0pl1-192ubuntu1) over (3.0pl1-189ubuntu1) ... 123s Preparing to unpack .../011-rsync_3.4.1-0syncable1_armhf.deb ... 123s Unpacking rsync (3.4.1-0syncable1) over (3.3.0-1) ... 123s Preparing to unpack .../012-python-apt-common_2.9.9_all.deb ... 123s Unpacking python-apt-common (2.9.9) over (2.9.0ubuntu2) ... 123s Preparing to unpack .../013-python3-apt_2.9.9_armhf.deb ... 123s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 123s for fn in glob1(directory, "%s.*" % fname): 123s Unpacking python3-apt (2.9.9) over (2.9.0ubuntu2) ... 123s Preparing to unpack .../014-python3-lazr.uri_1.0.6-5_all.deb ... 123s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 123s for fn in glob1(directory, "%s.*" % fname): 123s Unpacking python3-lazr.uri (1.0.6-5) over (1.0.6-4) ... 123s Preparing to unpack .../015-python3-launchpadlib_2.1.0-1_all.deb ... 123s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 123s for fn in glob1(directory, "%s.*" % fname): 123s Unpacking python3-launchpadlib (2.1.0-1) over (2.0.0-1) ... 124s Preparing to unpack .../016-python3-problem-report_2.31.0-0ubuntu5_all.deb ... 124s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 124s for fn in glob1(directory, "%s.*" % fname): 124s Unpacking python3-problem-report (2.31.0-0ubuntu5) over (2.30.0-0ubuntu5) ... 124s Preparing to unpack .../017-python3-apport_2.31.0-0ubuntu5_all.deb ... 124s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 124s for fn in glob1(directory, "%s.*" % fname): 124s Unpacking python3-apport (2.31.0-0ubuntu5) over (2.30.0-0ubuntu5) ... 124s Preparing to unpack .../018-python3-gi_3.50.0-4_armhf.deb ... 124s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 124s for fn in glob1(directory, "%s.*" % fname): 124s Unpacking python3-gi (3.50.0-4) over (3.50.0-3build1) ... 124s Preparing to unpack .../019-apport-core-dump-handler_2.31.0-0ubuntu5_all.deb ... 124s Unpacking apport-core-dump-handler (2.31.0-0ubuntu5) over (2.30.0-0ubuntu5) ... 124s Preparing to unpack .../020-apport_2.31.0-0ubuntu5_all.deb ... 124s Unpacking apport (2.31.0-0ubuntu5) over (2.30.0-0ubuntu5) ... 124s Preparing to unpack .../021-gcc-14-base_14.2.0-17ubuntu1_armhf.deb ... 124s Unpacking gcc-14-base:armhf (14.2.0-17ubuntu1) over (14.2.0-8ubuntu1) ... 124s Preparing to unpack .../022-libcom-err2_1.47.2-1ubuntu1_armhf.deb ... 124s Unpacking libcom-err2:armhf (1.47.2-1ubuntu1) over (1.47.1-1ubuntu1) ... 124s Preparing to unpack .../023-libss2_1.47.2-1ubuntu1_armhf.deb ... 124s Unpacking libss2:armhf (1.47.2-1ubuntu1) over (1.47.1-1ubuntu1) ... 124s Preparing to unpack .../024-openssl_3.4.0-1ubuntu2_armhf.deb ... 124s Unpacking openssl (3.4.0-1ubuntu2) over (3.3.1-2ubuntu2) ... 124s Preparing to unpack .../025-ca-certificates_20241223_all.deb ... 124s Unpacking ca-certificates (20241223) over (20240203) ... 124s Preparing to unpack .../026-distro-info_1.13_armhf.deb ... 124s Unpacking distro-info (1.13) over (1.12) ... 124s Preparing to unpack .../027-krb5-locales_1.21.3-4ubuntu1_all.deb ... 124s Unpacking krb5-locales (1.21.3-4ubuntu1) over (1.21.3-3) ... 124s Preparing to unpack .../028-libfribidi0_1.0.16-1_armhf.deb ... 124s Unpacking libfribidi0:armhf (1.0.16-1) over (1.0.15-1) ... 124s Preparing to unpack .../029-libgssapi-krb5-2_1.21.3-4ubuntu1_armhf.deb ... 124s Unpacking libgssapi-krb5-2:armhf (1.21.3-4ubuntu1) over (1.21.3-3) ... 124s Preparing to unpack .../030-libkrb5-3_1.21.3-4ubuntu1_armhf.deb ... 124s Unpacking libkrb5-3:armhf (1.21.3-4ubuntu1) over (1.21.3-3) ... 124s Preparing to unpack .../031-libkrb5support0_1.21.3-4ubuntu1_armhf.deb ... 124s Unpacking libkrb5support0:armhf (1.21.3-4ubuntu1) over (1.21.3-3) ... 125s Preparing to unpack .../032-libk5crypto3_1.21.3-4ubuntu1_armhf.deb ... 125s Unpacking libk5crypto3:armhf (1.21.3-4ubuntu1) over (1.21.3-3) ... 125s Preparing to unpack .../033-libicu74_74.2-1ubuntu6_armhf.deb ... 125s Unpacking libicu74:armhf (74.2-1ubuntu6) over (74.2-1ubuntu4) ... 125s Preparing to unpack .../034-libxml2_2.12.7+dfsg+really2.9.14-0.2ubuntu3_armhf.deb ... 125s Unpacking libxml2:armhf (2.12.7+dfsg+really2.9.14-0.2ubuntu3) over (2.12.7+dfsg-3) ... 125s Preparing to unpack .../035-python3-pygments_2.18.0+dfsg-2_all.deb ... 125s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 125s for fn in glob1(directory, "%s.*" % fname): 125s Unpacking python3-pygments (2.18.0+dfsg-2) over (2.18.0+dfsg-1ubuntu1) ... 125s Preparing to unpack .../036-python3-rich_13.9.4-1_all.deb ... 125s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 125s for fn in glob1(directory, "%s.*" % fname): 125s Unpacking python3-rich (13.9.4-1) over (13.7.1-1) ... 125s Preparing to unpack .../037-ucf_3.0049_all.deb ... 125s Unpacking ucf (3.0049) over (3.0043+nmu1) ... 125s Preparing to unpack .../038-rsyslog_8.2412.0-2ubuntu1_armhf.deb ... 125s Unpacking rsyslog (8.2412.0-2ubuntu1) over (8.2406.0-1ubuntu2) ... 125s Preparing to unpack .../039-apparmor_4.1.0~beta5-0ubuntu2_armhf.deb ... 127s Unpacking apparmor (4.1.0~beta5-0ubuntu2) over (4.1.0~beta1-0ubuntu4) ... 127s dpkg: warning: unable to delete old directory '/lib/apparmor': Directory not empty 127s Preparing to unpack .../040-bash-completion_1%3a2.16.0-7_all.deb ... 127s Unpacking bash-completion (1:2.16.0-7) over (1:2.14.0-2) ... 127s Preparing to unpack .../041-libmaxminddb0_1.12.2-1_armhf.deb ... 127s Unpacking libmaxminddb0:armhf (1.12.2-1) over (1.11.0-1) ... 127s Preparing to unpack .../042-liburcu8t64_0.15.1-1_armhf.deb ... 127s Unpacking liburcu8t64:armhf (0.15.1-1) over (0.14.1-1) ... 127s Preparing to unpack .../043-bind9-dnsutils_1%3a9.20.0-2ubuntu4_armhf.deb ... 127s Unpacking bind9-dnsutils (1:9.20.0-2ubuntu4) over (1:9.20.0-2ubuntu3) ... 127s Preparing to unpack .../044-bind9-host_1%3a9.20.0-2ubuntu4_armhf.deb ... 127s Unpacking bind9-host (1:9.20.0-2ubuntu4) over (1:9.20.0-2ubuntu3) ... 127s Preparing to unpack .../045-bind9-libs_1%3a9.20.0-2ubuntu4_armhf.deb ... 127s Unpacking bind9-libs:armhf (1:9.20.0-2ubuntu4) over (1:9.20.0-2ubuntu3) ... 127s Preparing to unpack .../046-libedit2_3.1-20250104-1_armhf.deb ... 127s Unpacking libedit2:armhf (3.1-20250104-1) over (3.1-20240808-1) ... 127s Preparing to unpack .../047-busybox-static_1%3a1.37.0-4ubuntu1_armhf.deb ... 127s Unpacking busybox-static (1:1.37.0-4ubuntu1) over (1:1.36.1-9ubuntu1) ... 127s Preparing to unpack .../048-cron-daemon-common_3.0pl1-192ubuntu1_all.deb ... 127s Unpacking cron-daemon-common (3.0pl1-192ubuntu1) over (3.0pl1-189ubuntu1) ... 127s Preparing to unpack .../049-libdevmapper1.02.1_2%3a1.02.201-1ubuntu1_armhf.deb ... 127s Unpacking libdevmapper1.02.1:armhf (2:1.02.201-1ubuntu1) over (2:1.02.196-1ubuntu2) ... 127s Preparing to unpack .../050-dmsetup_2%3a1.02.201-1ubuntu1_armhf.deb ... 127s Unpacking dmsetup (2:1.02.201-1ubuntu1) over (2:1.02.196-1ubuntu2) ... 127s Preparing to unpack .../051-ed_1.21-1_armhf.deb ... 127s Unpacking ed (1.21-1) over (1.20.2-2) ... 127s Preparing to unpack .../052-gettext-base_0.23.1-1_armhf.deb ... 127s Unpacking gettext-base (0.23.1-1) over (0.22.5-2) ... 127s Preparing to unpack .../053-groff-base_1.23.0-7_armhf.deb ... 127s Unpacking groff-base (1.23.0-7) over (1.23.0-5) ... 127s Preparing to unpack .../054-libibverbs1_55.0-1ubuntu1_armhf.deb ... 127s Unpacking libibverbs1:armhf (55.0-1ubuntu1) over (52.0-2ubuntu1) ... 127s Preparing to unpack .../055-ibverbs-providers_55.0-1ubuntu1_armhf.deb ... 127s Unpacking ibverbs-providers:armhf (55.0-1ubuntu1) over (52.0-2ubuntu1) ... 128s Preparing to unpack .../056-iputils-tracepath_3%3a20240905-1ubuntu1_armhf.deb ... 128s Unpacking iputils-tracepath (3:20240905-1ubuntu1) over (3:20240117-1build1) ... 128s Preparing to unpack .../057-nftables_1.1.1-1build1_armhf.deb ... 128s Unpacking nftables (1.1.1-1build1) over (1.1.0-2) ... 128s Preparing to unpack .../058-libnftables1_1.1.1-1build1_armhf.deb ... 128s Unpacking libnftables1:armhf (1.1.1-1build1) over (1.1.0-2) ... 128s Preparing to unpack .../059-libpcap0.8t64_1.10.5-2ubuntu1_armhf.deb ... 128s Unpacking libpcap0.8t64:armhf (1.10.5-2ubuntu1) over (1.10.5-1ubuntu1) ... 128s Preparing to unpack .../060-libpng16-16t64_1.6.46-4_armhf.deb ... 128s Unpacking libpng16-16t64:armhf (1.6.46-4) over (1.6.44-2) ... 128s Preparing to unpack .../061-libtraceevent1-plugin_1%3a1.8.4-2_armhf.deb ... 128s Unpacking libtraceevent1-plugin:armhf (1:1.8.4-2) over (1:1.8.4-1) ... 128s Preparing to unpack .../062-libtraceevent1_1%3a1.8.4-2_armhf.deb ... 128s Unpacking libtraceevent1:armhf (1:1.8.4-2) over (1:1.8.4-1) ... 128s Preparing to unpack .../063-libusb-1.0-0_2%3a1.0.27-2_armhf.deb ... 128s Unpacking libusb-1.0-0:armhf (2:1.0.27-2) over (2:1.0.27-1) ... 128s Preparing to unpack .../064-libxdmcp6_1%3a1.1.5-1_armhf.deb ... 128s Unpacking libxdmcp6:armhf (1:1.1.5-1) over (1:1.1.3-0ubuntu6) ... 128s Preparing to unpack .../065-libxkbcommon0_1.7.0-2_armhf.deb ... 128s Unpacking libxkbcommon0:armhf (1.7.0-2) over (1.7.0-1) ... 128s Preparing to unpack .../066-lshw_02.19.git.2021.06.19.996aaad9c7-2.1ubuntu1_armhf.deb ... 128s Unpacking lshw (02.19.git.2021.06.19.996aaad9c7-2.1ubuntu1) over (02.19.git.2021.06.19.996aaad9c7-2ubuntu2) ... 128s Preparing to unpack .../067-lsof_4.99.4+dfsg-1_armhf.deb ... 128s Unpacking lsof (4.99.4+dfsg-1) over (4.99.3+dfsg-2) ... 128s Preparing to unpack .../068-liblsof0_4.99.4+dfsg-1_armhf.deb ... 128s Unpacking liblsof0 (4.99.4+dfsg-1) over (4.99.3+dfsg-2) ... 128s Preparing to unpack .../069-nano_8.3-1_armhf.deb ... 128s Unpacking nano (8.3-1) over (8.2-1) ... 128s Preparing to unpack .../070-pci.ids_0.0~2025.02.12-1_all.deb ... 128s Unpacking pci.ids (0.0~2025.02.12-1) over (0.0~2024.10.24-1) ... 128s Preparing to unpack .../071-powermgmt-base_1.38_all.deb ... 128s Unpacking powermgmt-base (1.38) over (1.37+nmu1ubuntu1) ... 128s Preparing to unpack .../072-psmisc_23.7-2_armhf.deb ... 128s Unpacking psmisc (23.7-2) over (23.7-1build1) ... 128s Preparing to unpack .../073-publicsuffix_20250108.1153-0.1_all.deb ... 128s Unpacking publicsuffix (20250108.1153-0.1) over (20231001.0357-0.1) ... 128s Preparing to unpack .../074-python3-distro-info_1.13_all.deb ... 128s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 128s for fn in glob1(directory, "%s.*" % fname): 128s Unpacking python3-distro-info (1.13) over (1.12) ... 128s Preparing to unpack .../075-python3.13-gdbm_3.13.2-1_armhf.deb ... 128s Unpacking python3.13-gdbm (3.13.2-1) over (3.13.0-2) ... 128s Preparing to unpack .../076-python3.12-gdbm_3.12.9-1_armhf.deb ... 128s Unpacking python3.12-gdbm (3.12.9-1) over (3.12.7-3) ... 128s Preparing to unpack .../077-python3-gdbm_3.13.1-1_armhf.deb ... 128s Unpacking python3-gdbm:armhf (3.13.1-1) over (3.12.7-1) ... 128s Preparing to unpack .../078-ubuntu-standard_1.547_armhf.deb ... 128s Unpacking ubuntu-standard (1.547) over (1.544) ... 128s Preparing to unpack .../079-ufw_0.36.2-9_all.deb ... 129s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 129s for fn in glob1(directory, "%s.*" % fname): 129s Unpacking ufw (0.36.2-9) over (0.36.2-8) ... 129s Preparing to unpack .../080-usb.ids_2025.01.14-1_all.deb ... 129s Unpacking usb.ids (2025.01.14-1) over (2024.07.04-1) ... 129s Preparing to unpack .../081-xauth_1%3a1.1.2-1.1_armhf.deb ... 129s Unpacking xauth (1:1.1.2-1.1) over (1:1.1.2-1build1) ... 129s Preparing to unpack .../082-libcurl3t64-gnutls_8.12.0+git20250209.89ed161+ds-1ubuntu1_armhf.deb ... 129s Unpacking libcurl3t64-gnutls:armhf (8.12.0+git20250209.89ed161+ds-1ubuntu1) over (8.11.0-1ubuntu2) ... 129s Preparing to unpack .../083-libappstream5_1.0.4-1_armhf.deb ... 129s Unpacking libappstream5:armhf (1.0.4-1) over (1.0.3-1) ... 129s Preparing to unpack .../084-appstream_1.0.4-1_armhf.deb ... 129s Unpacking appstream (1.0.4-1) over (1.0.3-1) ... 129s Preparing to unpack .../085-libctf0_2.44-1ubuntu1_armhf.deb ... 129s Unpacking libctf0:armhf (2.44-1ubuntu1) over (2.43.1-4ubuntu1) ... 129s Preparing to unpack .../086-libctf-nobfd0_2.44-1ubuntu1_armhf.deb ... 129s Unpacking libctf-nobfd0:armhf (2.44-1ubuntu1) over (2.43.1-4ubuntu1) ... 129s Preparing to unpack .../087-binutils-arm-linux-gnueabihf_2.44-1ubuntu1_armhf.deb ... 129s Unpacking binutils-arm-linux-gnueabihf (2.44-1ubuntu1) over (2.43.1-4ubuntu1) ... 129s Preparing to unpack .../088-libbinutils_2.44-1ubuntu1_armhf.deb ... 129s Unpacking libbinutils:armhf (2.44-1ubuntu1) over (2.43.1-4ubuntu1) ... 129s Preparing to unpack .../089-binutils_2.44-1ubuntu1_armhf.deb ... 129s Unpacking binutils (2.44-1ubuntu1) over (2.43.1-4ubuntu1) ... 129s Preparing to unpack .../090-binutils-common_2.44-1ubuntu1_armhf.deb ... 129s Unpacking binutils-common:armhf (2.44-1ubuntu1) over (2.43.1-4ubuntu1) ... 129s Preparing to unpack .../091-libsframe1_2.44-1ubuntu1_armhf.deb ... 129s Unpacking libsframe1:armhf (2.44-1ubuntu1) over (2.43.1-4ubuntu1) ... 129s Preparing to unpack .../092-btrfs-progs_6.12-1build1_armhf.deb ... 129s Unpacking btrfs-progs (6.12-1build1) over (6.6.3-1.2) ... 129s Preparing to unpack .../093-python3-jinja2_3.1.5-2_all.deb ... 129s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 129s for fn in glob1(directory, "%s.*" % fname): 129s Unpacking python3-jinja2 (3.1.5-2) over (3.1.3-1ubuntu1) ... 129s Preparing to unpack .../094-python3-json-pointer_2.4-3_all.deb ... 130s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 130s for fn in glob1(directory, "%s.*" % fname): 130s Unpacking python3-json-pointer (2.4-3) over (2.4-2) ... 130s Preparing to unpack .../095-python3-jsonpatch_1.32-5_all.deb ... 130s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 130s for fn in glob1(directory, "%s.*" % fname): 130s Unpacking python3-jsonpatch (1.32-5) over (1.32-4) ... 130s Preparing to unpack .../096-python3-attr_25.1.0-1_all.deb ... 130s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 130s for fn in glob1(directory, "%s.*" % fname): 130s Unpacking python3-attr (25.1.0-1) over (23.2.0-2) ... 130s Preparing to unpack .../097-python3-referencing_0.35.1-2ubuntu1_all.deb ... 130s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 130s for fn in glob1(directory, "%s.*" % fname): 130s Unpacking python3-referencing (0.35.1-2ubuntu1) over (0.35.1-1ubuntu1) ... 130s Preparing to unpack .../098-python3-jsonschema_4.19.2-6ubuntu1_all.deb ... 130s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 130s for fn in glob1(directory, "%s.*" % fname): 130s Unpacking python3-jsonschema (4.19.2-6ubuntu1) over (4.19.2-3ubuntu1) ... 130s Preparing to unpack .../099-python3-jwt_2.10.1-2_all.deb ... 130s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 130s for fn in glob1(directory, "%s.*" % fname): 130s Unpacking python3-jwt (2.10.1-2) over (2.7.0-1) ... 130s Preparing to unpack .../100-python3-oauthlib_3.2.2-3_all.deb ... 130s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 130s for fn in glob1(directory, "%s.*" % fname): 130s Unpacking python3-oauthlib (3.2.2-3) over (3.2.2-2) ... 130s Preparing to unpack .../101-cloud-init-base_25.1~3geb1965a4-0ubuntu1_all.deb ... 130s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 130s for fn in glob1(directory, "%s.*" % fname): 130s Unpacking cloud-init-base (25.1~3geb1965a4-0ubuntu1) over (24.4-0ubuntu1) ... 131s dpkg: warning: unable to delete old directory '/lib/systemd/system/sshd-keygen@.service.d': Directory not empty 131s Preparing to unpack .../102-curl_8.12.0+git20250209.89ed161+ds-1ubuntu1_armhf.deb ... 131s Unpacking curl (8.12.0+git20250209.89ed161+ds-1ubuntu1) over (8.11.0-1ubuntu2) ... 131s Preparing to unpack .../103-libcurl4t64_8.12.0+git20250209.89ed161+ds-1ubuntu1_armhf.deb ... 131s Unpacking libcurl4t64:armhf (8.12.0+git20250209.89ed161+ds-1ubuntu1) over (8.11.0-1ubuntu2) ... 131s Preparing to unpack .../104-dpkg-dev_1.22.11ubuntu4_all.deb ... 131s Unpacking dpkg-dev (1.22.11ubuntu4) over (1.22.11ubuntu3) ... 131s Preparing to unpack .../105-libdpkg-perl_1.22.11ubuntu4_all.deb ... 131s Unpacking libdpkg-perl (1.22.11ubuntu4) over (1.22.11ubuntu3) ... 131s Preparing to unpack .../106-make_4.4.1-1_armhf.deb ... 131s Unpacking make (4.4.1-1) over (4.3-4.1build2) ... 131s Preparing to unpack .../107-libarchive13t64_3.7.7-0ubuntu1_armhf.deb ... 131s Unpacking libarchive13t64:armhf (3.7.7-0ubuntu1) over (3.7.4-1.1) ... 131s Preparing to unpack .../108-libjson-glib-1.0-common_1.10.6+ds-1_all.deb ... 131s Unpacking libjson-glib-1.0-common (1.10.6+ds-1) over (1.10.0+ds-3) ... 131s Preparing to unpack .../109-libjson-glib-1.0-0_1.10.6+ds-1_armhf.deb ... 131s Unpacking libjson-glib-1.0-0:armhf (1.10.6+ds-1) over (1.10.0+ds-3) ... 131s Preparing to unpack .../110-fwupd_2.0.5-1_armhf.deb ... 131s Unpacking fwupd (2.0.5-1) over (2.0.2-1) ... 131s Preparing to unpack .../111-libfwupd3_2.0.5-1_armhf.deb ... 131s Unpacking libfwupd3:armhf (2.0.5-1) over (2.0.2-1) ... 131s Preparing to unpack .../112-polkitd_126-2_armhf.deb ... 132s Unpacking polkitd (126-2) over (125-2ubuntu1) ... 132s Preparing to unpack .../113-libpolkit-agent-1-0_126-2_armhf.deb ... 132s Unpacking libpolkit-agent-1-0:armhf (126-2) over (125-2ubuntu1) ... 132s Preparing to unpack .../114-libpolkit-gobject-1-0_126-2_armhf.deb ... 132s Unpacking libpolkit-gobject-1-0:armhf (126-2) over (125-2ubuntu1) ... 132s Preparing to unpack .../115-libprotobuf-c1_1.5.1-1ubuntu1_armhf.deb ... 132s Unpacking libprotobuf-c1:armhf (1.5.1-1ubuntu1) over (1.4.1-1ubuntu4) ... 132s Preparing to unpack .../116-libqmi-proxy_1.35.6-1_armhf.deb ... 132s Unpacking libqmi-proxy (1.35.6-1) over (1.35.2-0ubuntu2) ... 132s Preparing to unpack .../117-libqmi-glib5_1.35.6-1_armhf.deb ... 132s Unpacking libqmi-glib5:armhf (1.35.6-1) over (1.35.2-0ubuntu2) ... 132s Preparing to unpack .../118-libpackagekit-glib2-18_1.3.0-3build1_armhf.deb ... 132s Unpacking libpackagekit-glib2-18:armhf (1.3.0-3build1) over (1.3.0-2) ... 132s Preparing to unpack .../119-gir1.2-packagekitglib-1.0_1.3.0-3build1_armhf.deb ... 132s Unpacking gir1.2-packagekitglib-1.0 (1.3.0-3build1) over (1.3.0-2) ... 132s Preparing to unpack .../120-gnupg-l10n_2.4.4-2ubuntu22_all.deb ... 132s Unpacking gnupg-l10n (2.4.4-2ubuntu22) over (2.4.4-2ubuntu18) ... 132s Preparing to unpack .../121-htop_3.3.0-5_armhf.deb ... 132s Unpacking htop (3.3.0-5) over (3.3.0-4build1) ... 132s Preparing to unpack .../122-libblockdev-utils3_3.3.0-1_armhf.deb ... 132s Unpacking libblockdev-utils3:armhf (3.3.0-1) over (3.2.1-1) ... 132s Preparing to unpack .../123-libnspr4_2%3a4.36-1ubuntu1_armhf.deb ... 132s Unpacking libnspr4:armhf (2:4.36-1ubuntu1) over (2:4.35-1.1ubuntu2) ... 132s Preparing to unpack .../124-libnss3_2%3a3.107-1ubuntu1_armhf.deb ... 132s Unpacking libnss3:armhf (2:3.107-1ubuntu1) over (2:3.103-1) ... 132s Preparing to unpack .../125-libgpgme11t64_1.24.2-1ubuntu1_armhf.deb ... 132s Unpacking libgpgme11t64:armhf (1.24.2-1ubuntu1) over (1.24.0-2ubuntu1) ... 132s Preparing to unpack .../126-libvolume-key1_0.3.12-9_armhf.deb ... 132s Unpacking libvolume-key1:armhf (0.3.12-9) over (0.3.12-8) ... 132s Preparing to unpack .../127-libblockdev-crypto3_3.3.0-1_armhf.deb ... 132s Unpacking libblockdev-crypto3:armhf (3.3.0-1) over (3.2.1-1) ... 132s Preparing to unpack .../128-libblockdev-fs3_3.3.0-1_armhf.deb ... 132s Unpacking libblockdev-fs3:armhf (3.3.0-1) over (3.2.1-1) ... 132s Preparing to unpack .../129-libblockdev-loop3_3.3.0-1_armhf.deb ... 132s Unpacking libblockdev-loop3:armhf (3.3.0-1) over (3.2.1-1) ... 132s Preparing to unpack .../130-libblockdev-mdraid3_3.3.0-1_armhf.deb ... 132s Unpacking libblockdev-mdraid3:armhf (3.3.0-1) over (3.2.1-1) ... 132s Preparing to unpack .../131-libnvme1t64_1.11.1-2_armhf.deb ... 132s Unpacking libnvme1t64 (1.11.1-2) over (1.11.1-1) ... 132s Preparing to unpack .../132-libblockdev-nvme3_3.3.0-1_armhf.deb ... 132s Unpacking libblockdev-nvme3:armhf (3.3.0-1) over (3.2.1-1) ... 132s Preparing to unpack .../133-libblockdev-part3_3.3.0-1_armhf.deb ... 132s Unpacking libblockdev-part3:armhf (3.3.0-1) over (3.2.1-1) ... 132s Preparing to unpack .../134-libblockdev-swap3_3.3.0-1_armhf.deb ... 132s Unpacking libblockdev-swap3:armhf (3.3.0-1) over (3.2.1-1) ... 132s Preparing to unpack .../135-libblockdev3_3.3.0-1_armhf.deb ... 132s Unpacking libblockdev3:armhf (3.3.0-1) over (3.2.1-1) ... 132s Preparing to unpack .../136-libftdi1-2_1.5-8_armhf.deb ... 132s Unpacking libftdi1-2:armhf (1.5-8) over (1.5-7build1) ... 133s Preparing to unpack .../137-libgstreamer1.0-0_1.25.50-1_armhf.deb ... 133s Unpacking libgstreamer1.0-0:armhf (1.25.50-1) over (1.24.9-1) ... 133s Preparing to unpack .../138-libgudev-1.0-0_1%3a238-6_armhf.deb ... 133s Unpacking libgudev-1.0-0:armhf (1:238-6) over (1:238-5ubuntu1) ... 133s Selecting previously unselected package libicu76:armhf. 133s Preparing to unpack .../139-libicu76_76.1-1ubuntu2_armhf.deb ... 133s Unpacking libicu76:armhf (76.1-1ubuntu2) ... 133s Preparing to unpack .../140-libsasl2-modules_2.1.28+dfsg1-8build1_armhf.deb ... 133s Unpacking libsasl2-modules:armhf (2.1.28+dfsg1-8build1) over (2.1.28+dfsg1-8) ... 133s Preparing to unpack .../141-udisks2_2.10.1-11ubuntu2_armhf.deb ... 133s Unpacking udisks2 (2.10.1-11ubuntu2) over (2.10.1-11ubuntu1) ... 133s Preparing to unpack .../142-libudisks2-0_2.10.1-11ubuntu2_armhf.deb ... 133s Unpacking libudisks2-0:armhf (2.10.1-11ubuntu2) over (2.10.1-11ubuntu1) ... 133s Preparing to unpack .../143-libwrap0_7.6.q-35_armhf.deb ... 133s Unpacking libwrap0:armhf (7.6.q-35) over (7.6.q-33) ... 133s Selecting previously unselected package linux-headers-6.12.0-15. 133s Preparing to unpack .../144-linux-headers-6.12.0-15_6.12.0-15.15_all.deb ... 133s Unpacking linux-headers-6.12.0-15 (6.12.0-15.15) ... 136s Selecting previously unselected package linux-headers-6.12.0-15-generic. 136s Preparing to unpack .../145-linux-headers-6.12.0-15-generic_6.12.0-15.15_armhf.deb ... 136s Unpacking linux-headers-6.12.0-15-generic (6.12.0-15.15) ... 137s Preparing to unpack .../146-linux-headers-generic_6.12.0-15.15+1_armhf.deb ... 137s Unpacking linux-headers-generic (6.12.0-15.15+1) over (6.11.0-8.8) ... 137s Preparing to unpack .../147-packagekit-tools_1.3.0-3build1_armhf.deb ... 137s Unpacking packagekit-tools (1.3.0-3build1) over (1.3.0-2) ... 137s Preparing to unpack .../148-packagekit_1.3.0-3build1_armhf.deb ... 137s Unpacking packagekit (1.3.0-3build1) over (1.3.0-2) ... 137s Preparing to unpack .../149-pollinate_4.33-4ubuntu2_all.deb ... 137s Unpacking pollinate (4.33-4ubuntu2) over (4.33-4ubuntu1) ... 137s Preparing to unpack .../150-python3-babel_2.17.0-1_all.deb ... 137s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 137s for fn in glob1(directory, "%s.*" % fname): 138s Unpacking python3-babel (2.17.0-1) over (2.16.0-1) ... 138s Preparing to unpack .../151-python-babel-localedata_2.17.0-1_all.deb ... 138s Unpacking python-babel-localedata (2.17.0-1) over (2.16.0-1) ... 138s Preparing to unpack .../152-python3-certifi_2025.1.31+ds-1_all.deb ... 138s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 138s for fn in glob1(directory, "%s.*" % fname): 138s Unpacking python3-certifi (2025.1.31+ds-1) over (2024.8.30+dfsg-1) ... 138s Preparing to unpack .../153-python3-chardet_5.2.0+dfsg-2_all.deb ... 138s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 138s for fn in glob1(directory, "%s.*" % fname): 138s Unpacking python3-chardet (5.2.0+dfsg-2) over (5.2.0+dfsg-1) ... 138s Preparing to unpack .../154-python3-idna_3.10-1_all.deb ... 138s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 138s for fn in glob1(directory, "%s.*" % fname): 138s Unpacking python3-idna (3.10-1) over (3.8-2) ... 138s Preparing to unpack .../155-python3-more-itertools_10.6.0-1_all.deb ... 138s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 138s for fn in glob1(directory, "%s.*" % fname): 138s Unpacking python3-more-itertools (10.6.0-1) over (10.5.0-1) ... 138s Preparing to unpack .../156-python3-openssl_25.0.0-1_all.deb ... 139s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 139s for fn in glob1(directory, "%s.*" % fname): 139s Unpacking python3-openssl (25.0.0-1) over (24.2.1-1) ... 139s Preparing to unpack .../157-python3-pkg-resources_75.6.0-1_all.deb ... 139s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 139s for fn in glob1(directory, "%s.*" % fname): 139s Unpacking python3-pkg-resources (75.6.0-1) over (75.2.0-1) ... 139s Preparing to unpack .../158-python3-setuptools_75.6.0-1_all.deb ... 139s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 139s for fn in glob1(directory, "%s.*" % fname): 139s Unpacking python3-setuptools (75.6.0-1) over (75.2.0-1) ... 139s Preparing to unpack .../159-software-properties-common_0.108_all.deb ... 139s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 139s for fn in glob1(directory, "%s.*" % fname): 139s Unpacking software-properties-common (0.108) over (0.105) ... 139s Preparing to unpack .../160-python3-software-properties_0.108_all.deb ... 139s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 139s for fn in glob1(directory, "%s.*" % fname): 139s Unpacking python3-software-properties (0.108) over (0.105) ... 139s Preparing to unpack .../161-python3-urllib3_2.3.0-1_all.deb ... 139s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 139s for fn in glob1(directory, "%s.*" % fname): 139s Unpacking python3-urllib3 (2.3.0-1) over (2.0.7-2ubuntu0.1) ... 139s Preparing to unpack .../162-python3-wadllib_2.0.0-2_all.deb ... 139s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 139s for fn in glob1(directory, "%s.*" % fname): 139s Unpacking python3-wadllib (2.0.0-2) over (2.0.0-1) ... 140s Preparing to unpack .../163-unattended-upgrades_2.12ubuntu3_all.deb ... 140s Unpacking unattended-upgrades (2.12ubuntu3) over (2.9.1+nmu4ubuntu1) ... 140s dpkg: warning: unable to delete old directory '/lib/systemd/system-sleep': Directory not empty 140s Preparing to unpack .../164-xfsprogs_6.12.0-1ubuntu1_armhf.deb ... 140s Unpacking xfsprogs (6.12.0-1ubuntu1) over (6.8.0-2.2ubuntu2) ... 140s Preparing to unpack .../165-zstd_1.5.6+dfsg-2_armhf.deb ... 140s Unpacking zstd (1.5.6+dfsg-2) over (1.5.6+dfsg-1) ... 140s Preparing to unpack .../166-cloud-init_25.1~3geb1965a4-0ubuntu1_all.deb ... 140s Unpacking cloud-init (25.1~3geb1965a4-0ubuntu1) over (24.4-0ubuntu1) ... 140s Preparing to unpack .../167-kpartx_0.9.9-1ubuntu4_armhf.deb ... 140s Unpacking kpartx (0.9.9-1ubuntu4) over (0.9.9-1ubuntu3) ... 140s Preparing to unpack .../168-multipath-tools_0.9.9-1ubuntu4_armhf.deb ... 140s Unpacking multipath-tools (0.9.9-1ubuntu4) over (0.9.9-1ubuntu3) ... 140s Setting up libip4tc2:armhf (1.8.11-2ubuntu1) ... 140s Setting up powermgmt-base (1.38) ... 140s Setting up distro-info (1.13) ... 140s Setting up liburcu8t64:armhf (0.15.1-1) ... 140s Setting up libibverbs1:armhf (55.0-1ubuntu1) ... 140s Setting up libxdmcp6:armhf (1:1.1.5-1) ... 140s Setting up pci.ids (0.0~2025.02.12-1) ... 140s Setting up libnewt0.52:armhf (0.52.24-4ubuntu1) ... 140s Setting up apt-utils (2.9.30) ... 140s Setting up bsdextrautils (2.40.2-14ubuntu1) ... 140s Setting up init (1.68) ... 140s Setting up ibverbs-providers:armhf (55.0-1ubuntu1) ... 140s Setting up gcc-14-base:armhf (14.2.0-17ubuntu1) ... 140s Setting up psmisc (23.7-2) ... 140s Setting up libyaml-0-2:armhf (0.2.5-2) ... 140s Setting up libip6tc2:armhf (1.8.11-2ubuntu1) ... 140s Setting up liblsof0 (4.99.4+dfsg-1) ... 140s Setting up libmaxminddb0:armhf (1.12.2-1) ... 140s Setting up python3.12-gdbm (3.12.9-1) ... 140s Setting up libedit2:armhf (3.1-20250104-1) ... 140s Setting up libsasl2-modules:armhf (2.1.28+dfsg1-8build1) ... 140s Setting up netcat-openbsd (1.228-1) ... 140s Setting up libpython3.12-minimal:armhf (3.12.9-1) ... 140s Setting up binutils-common:armhf (2.44-1ubuntu1) ... 140s Setting up libctf-nobfd0:armhf (2.44-1ubuntu1) ... 140s Setting up gettext-base (0.23.1-1) ... 140s Setting up libnss-systemd:armhf (257.2-3ubuntu1) ... 140s Setting up libnftnl11:armhf (1.2.8-1) ... 140s Setting up krb5-locales (1.21.3-4ubuntu1) ... 140s Setting up libcom-err2:armhf (1.47.2-1ubuntu1) ... 140s Setting up lshw (02.19.git.2021.06.19.996aaad9c7-2.1ubuntu1) ... 140s Setting up locales (2.40-4ubuntu1) ... 141s Generating locales (this might take a while)... 143s en_US.UTF-8... done 143s Generation complete. 143s Setting up libldap-common (2.6.9+dfsg-1~exp2ubuntu1) ... 143s Installing new version of config file /etc/ldap/ldap.conf ... 143s Setting up libprotobuf-c1:armhf (1.5.1-1ubuntu1) ... 143s Setting up libsframe1:armhf (2.44-1ubuntu1) ... 143s Setting up python-babel-localedata (2.17.0-1) ... 143s Setting up libkrb5support0:armhf (1.21.3-4ubuntu1) ... 143s Setting up libsasl2-modules-db:armhf (2.1.28+dfsg1-8build1) ... 143s Setting up tzdata (2025a-2ubuntu1) ... 143s 143s Current default time zone: 'Etc/UTC' 143s Local time is now: Wed Feb 19 19:30:26 UTC 2025. 143s Universal Time is now: Wed Feb 19 19:30:26 UTC 2025. 143s Run 'dpkg-reconfigure tzdata' if you wish to change it. 143s 143s Setting up eject (2.40.2-14ubuntu1) ... 143s Setting up apparmor (4.1.0~beta5-0ubuntu2) ... 143s Installing new version of config file /etc/apparmor.d/abstractions/dconf ... 143s Installing new version of config file /etc/apparmor.d/abstractions/mesa ... 143s Installing new version of config file /etc/apparmor.d/abstractions/nameservice ... 143s Installing new version of config file /etc/apparmor.d/abstractions/php ... 143s Installing new version of config file /etc/apparmor.d/abstractions/python ... 143s Installing new version of config file /etc/apparmor.d/slirp4netns ... 143s Installing new version of config file /etc/apparmor.d/toybox ... 143s Installing new version of config file /etc/apparmor.d/transmission ... 143s Installing new version of config file /etc/apparmor.d/tunables/global ... 143s apparmor_parser: Unable to replace "lsb_release". apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 143s 143s apparmor_parser: Unable to replace "kmod". apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 143s 143s apparmor_parser: Unable to replace "nvidia_modprobe". apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 143s 144s Reloading AppArmor profiles 144s /sbin/apparmor_parser: Unable to replace "1password". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "Discord". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "MongoDB Compass". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "QtWebEngineProcess". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "balena-etcher". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "brave". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "buildah". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "busybox". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "cam". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "ch-checkns". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "ch-run". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "chrome". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "bwrap". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "chromium". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "vscode". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "crun". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "devhelp". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "element-desktop". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "bfdd". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "babeld". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "bgpd". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "epiphany". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "evolution". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "firefox". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "flatpak". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "alsamixer". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "foliate". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "geary". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "github-desktop". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "goldendict". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "ipa_verify". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "dnstracer". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "kchmviewer". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "keybase". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "eigrpd". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "lc-compliance". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "libcamerify". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "fabricd". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "fusermount3". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "iotop-c". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "loupe". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "linux-sandbox". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "lxc-attach". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "lxc-create". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "isisd". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "lxc-destroy". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "lxc-execute". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "lxc-stop". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "Xorg". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "lxc-unshare". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "lxc-usernsexec". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "mmdebstrap". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "msedge". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "ldpd". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "nautilus". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "lsusb". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "lsblk". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "notepadqq". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "obsidian". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "opam". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "lsb_release". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "mosquitto". /sbin/apparmor_parser: Unable to replace "opera". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "mbsync". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "pageedit". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "nhrpd". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "irssi". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "kmod". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "nvidia_modprobe". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "ospf6d". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "nc.openbsd". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "ospfd". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "podman". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "polypane". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "privacybrowser". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "qcam". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "pbrd". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "pathd". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "qmapshack". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "qutebrowser". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "pim6d". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "rootlesskit". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "rpm". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "rssguard". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "runc". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "QtWebEngineProcess". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "plasmashell". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "sbuild". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "sbuild-abort". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "sbuild-adduser". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "sbuild-apt". /sbin/apparmor_parser: Unable to replace "sbuild-checkpackages". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "pimd". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "sbuild-clean". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "sbuild-createchroot". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "sbuild-destroychroot". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "sbuild-distupgrade". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "sbuild-hold". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "sbuild-unhold". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "sbuild-shell". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "sbuild-update". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "ripngd". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "sbuild-upgrade". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "scide". /sbin/apparmor_parser: Unable to replace "signal-desktop". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "slack". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "slirp4netns". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "ripd". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "steam". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "surfshark". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "stress-ng". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "systemd-coredump". /sbin/apparmor_parser: Unable to replace "ip". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "openvpn". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "thunderbird". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "toybox". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "trinity". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "tup". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "tuxedo-control-center". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "staticd". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "tinyproxy". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "unix-chkpwd". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "unprivileged_userns". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "ubuntu_pro_apt_news". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "unpriv_unshare". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "userbindmount". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "mx-extract". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "rygel". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "rsyslogd". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "/usr/bin/man". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "uwsgi-core". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "vdens". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "virtiofsd". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "vivaldi-bin". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "vpnns". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "dumpcap". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "tshark". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "cmds". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "tnftp". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "wike". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "wg". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "vrrpd". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "wpcom". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "wpa_supplicant". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "ip". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "wg-quick". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "tcpdump". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "znc". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "remmina". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "apt_methods". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "ubuntu_pro_esm_cache". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s /sbin/apparmor_parser: Unable to replace "transmission-cli". /sbin/apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 144s 144s Error: At least one profile failed to load 144s Setting up libglib2.0-data (2.83.3-2) ... 144s Setting up busybox-static (1:1.37.0-4ubuntu1) ... 144s Setting up systemd-cryptsetup (257.2-3ubuntu1) ... 144s Setting up libwrap0:armhf (7.6.q-35) ... 144s Setting up libnvme1t64 (1.11.1-2) ... 144s Setting up make (4.4.1-1) ... 144s Setting up libnspr4:armhf (2:4.36-1ubuntu1) ... 144s Setting up gnupg-l10n (2.4.4-2ubuntu22) ... 144s Setting up ed (1.21-1) ... 144s Setting up bash-completion (1:2.16.0-7) ... 144s Setting up libncurses6:armhf (6.5+20250125-2) ... 144s Setting up libdbus-1-3:armhf (1.16.0-1ubuntu1) ... 144s Setting up libfribidi0:armhf (1.0.16-1) ... 144s Setting up libpng16-16t64:armhf (1.6.46-4) ... 144s Setting up systemd-timesyncd (257.2-3ubuntu1) ... 145s systemd-time-wait-sync.service is a disabled or a static unit not running, not starting it. 145s Setting up libatomic1:armhf (15-20250213-1ubuntu1) ... 145s Setting up udev (257.2-3ubuntu1) ... 146s Setting up libss2:armhf (1.47.2-1ubuntu1) ... 146s Setting up usb.ids (2025.01.14-1) ... 146s Setting up dhcpcd-base (1:10.1.0-7) ... 146s Installing new version of config file /etc/dhcpcd.conf ... 146s Setting up ucf (3.0049) ... 146s Installing new version of config file /etc/ucf.conf ... 146s Setting up libncursesw6:armhf (6.5+20250125-2) ... 146s Setting up libk5crypto3:armhf (1.21.3-4ubuntu1) ... 146s Setting up busybox-initramfs (1:1.37.0-4ubuntu1) ... 146s Setting up libxtables12:armhf (1.8.11-2ubuntu1) ... 146s Setting up libdpkg-perl (1.22.11ubuntu4) ... 146s Setting up logsave (1.47.2-1ubuntu1) ... 146s Setting up libsasl2-2:armhf (2.1.28+dfsg1-8build1) ... 146s Setting up lsof (4.99.4+dfsg-1) ... 146s Setting up libfdisk1:armhf (2.40.2-14ubuntu1) ... 146s Setting up libicu74:armhf (74.2-1ubuntu6) ... 146s Setting up nano (8.3-1) ... 146s Installing new version of config file /etc/nanorc ... 146s Setting up libdevmapper1.02.1:armhf (2:1.02.201-1ubuntu1) ... 146s Setting up whiptail (0.52.24-4ubuntu1) ... 146s Setting up python-apt-common (2.9.9) ... 146s Setting up dracut-install (106-2ubuntu1) ... 146s Setting up dmsetup (2:1.02.201-1ubuntu1) ... 146s Setting up uuid-runtime (2.40.2-14ubuntu1) ... 147s uuidd.service is a disabled or a static unit not running, not starting it. 147s Setting up xauth (1:1.1.2-1.1) ... 147s Setting up groff-base (1.23.0-7) ... 147s Setting up libtraceevent1:armhf (1:1.8.4-2) ... 147s Setting up dbus-session-bus-common (1.16.0-1ubuntu1) ... 147s Setting up kpartx (0.9.9-1ubuntu4) ... 147s Setting up libpcap0.8t64:armhf (1.10.5-2ubuntu1) ... 147s Setting up libjson-glib-1.0-common (1.10.6+ds-1) ... 147s Setting up mawk (1.3.4.20250131-1) ... 147s Setting up libkrb5-3:armhf (1.21.3-4ubuntu1) ... 147s Setting up libusb-1.0-0:armhf (2:1.0.27-2) ... 147s Setting up libicu76:armhf (76.1-1ubuntu2) ... 147s Setting up linux-headers-6.12.0-15 (6.12.0-15.15) ... 147s Setting up keyboard-configuration (1.226ubuntu3) ... 147s Your console font configuration will be updated the next time your system 147s boots. If you want to update it now, run 'setupcon' from a virtual console. 147s update-initramfs: deferring update (trigger activated) 147s Setting up libbinutils:armhf (2.44-1ubuntu1) ... 147s Setting up dbus-system-bus-common (1.16.0-1ubuntu1) ... 148s Setting up openssl (3.4.0-1ubuntu2) ... 148s Installing new version of config file /etc/ssl/openssl.cnf ... 148s Setting up libgpg-error-l10n (1.51-3) ... 148s Setting up iputils-ping (3:20240905-1ubuntu1) ... 148s Setting up readline-common (8.2-6) ... 148s Setting up publicsuffix (20250108.1153-0.1) ... 148s Setting up libxml2:armhf (2.12.7+dfsg+really2.9.14-0.2ubuntu3) ... 148s Setting up zstd (1.5.6+dfsg-2) ... 148s Setting up libldap2:armhf (2.6.9+dfsg-1~exp2ubuntu1) ... 148s Setting up dbus-bin (1.16.0-1ubuntu1) ... 148s Setting up libbpf1:armhf (1:1.5.0-2) ... 148s Setting up iputils-tracepath (3:20240905-1ubuntu1) ... 148s Setting up rsync (3.4.1-0syncable1) ... 148s rsync.service is a disabled or a static unit not running, not starting it. 148s Setting up python3.13-gdbm (3.13.2-1) ... 148s Setting up ethtool (1:6.11-1) ... 148s Setting up gnupg-utils (2.4.4-2ubuntu22) ... 148s Setting up initramfs-tools-bin (0.145ubuntu2) ... 148s Setting up ncurses-term (6.5+20250125-2) ... 148s Setting up login (1:4.16.0-2+really2.40.2-14ubuntu1) ... 148s Setting up cron-daemon-common (3.0pl1-192ubuntu1) ... 148s Setting up libxkbcommon0:armhf (1.7.0-2) ... 148s Setting up libctf0:armhf (2.44-1ubuntu1) ... 148s Setting up pinentry-curses (1.3.1-2ubuntu2) ... 148s Setting up python3.12-minimal (3.12.9-1) ... 149s Setting up libnftables1:armhf (1.1.1-1build1) ... 149s Setting up nftables (1.1.1-1build1) ... 150s Setting up iptables (1.8.11-2ubuntu1) ... 150s Setting up htop (3.3.0-5) ... 150s Setting up iproute2 (6.13.0-1ubuntu1) ... 150s Setting up btrfs-progs (6.12-1build1) ... 150s Setting up cron (3.0pl1-192ubuntu1) ... 151s Setting up rsyslog (8.2412.0-2ubuntu1) ... 151s Installing new version of config file /etc/apparmor.d/usr.sbin.rsyslogd ... 151s info: The user `syslog' is already a member of `adm'. 151s apparmor_parser: Unable to replace "rsyslogd". apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 151s 152s Setting up e2fsprogs (1.47.2-1ubuntu1) ... 152s update-initramfs: deferring update (trigger activated) 152s Setting up libnss3:armhf (2:3.107-1ubuntu1) ... 152s Setting up dbus-daemon (1.16.0-1ubuntu1) ... 152s Setting up multipath-tools (0.9.9-1ubuntu4) ... 153s Setting up libftdi1-2:armhf (1.5-8) ... 153s Setting up ca-certificates (20241223) ... 155s Updating certificates in /etc/ssl/certs... 157s rehash: warning: skipping ca-certificates.crt, it does not contain exactly one certificate or CRL 157s 7 added, 1 removed; done. 157s Setting up libglib2.0-0t64:armhf (2.83.3-2) ... 157s No schema files found: doing nothing. 157s Setting up dbus (1.16.0-1ubuntu1) ... 157s A reboot is required to replace the running dbus-daemon. 157s Please reboot the system when convenient. 157s Setting up libblockdev-utils3:armhf (3.3.0-1) ... 157s Setting up linux-headers-6.12.0-15-generic (6.12.0-15.15) ... 157s Setting up libgssapi-krb5-2:armhf (1.21.3-4ubuntu1) ... 157s Setting up gir1.2-glib-2.0:armhf (2.83.3-2) ... 157s Setting up libreadline8t64:armhf (8.2-6) ... 157s Setting up libblockdev-nvme3:armhf (3.3.0-1) ... 157s Setting up libblockdev-fs3:armhf (3.3.0-1) ... 157s Setting up libtraceevent1-plugin:armhf (1:1.8.4-2) ... 157s Setting up gpgconf (2.4.4-2ubuntu22) ... 157s Setting up libpam-systemd:armhf (257.2-3ubuntu1) ... 157s Setting up libgirepository-1.0-1:armhf (1.82.0-4) ... 157s Setting up console-setup-linux (1.226ubuntu3) ... 158s Setting up initramfs-tools-core (0.145ubuntu2) ... 158s Setting up binutils-arm-linux-gnueabihf (2.44-1ubuntu1) ... 158s Setting up libarchive13t64:armhf (3.7.7-0ubuntu1) ... 158s Setting up libpython3.13-stdlib:armhf (3.13.2-1) ... 158s Setting up gpg (2.4.4-2ubuntu22) ... 158s Setting up libgudev-1.0-0:armhf (1:238-6) ... 158s Setting up libpolkit-gobject-1-0:armhf (126-2) ... 158s Setting up libgstreamer1.0-0:armhf (1.25.50-1) ... 158s Setcap worked! gst-ptp-helper is not suid! 158s Setting up libudisks2-0:armhf (2.10.1-11ubuntu2) ... 158s Setting up libpython3-stdlib:armhf (3.13.1-1~exp2) ... 158s Setting up systemd-resolved (257.2-3ubuntu1) ... 159s Setting up console-setup (1.226ubuntu3) ... 160s update-initramfs: deferring update (trigger activated) 160s Setting up gpg-agent (2.4.4-2ubuntu22) ... 160s Setting up libpython3.12-stdlib:armhf (3.12.9-1) ... 160s Setting up initramfs-tools (0.145ubuntu2) ... 160s update-initramfs: deferring update (trigger activated) 160s Setting up libblockdev-mdraid3:armhf (3.3.0-1) ... 160s Setting up libcurl4t64:armhf (8.12.0+git20250209.89ed161+ds-1ubuntu1) ... 160s Setting up bind9-libs:armhf (1:9.20.0-2ubuntu4) ... 160s Setting up e2fsprogs-l10n (1.47.2-1ubuntu1) ... 160s Setting up python3.13 (3.13.2-1) ... 161s Setting up libblockdev-swap3:armhf (3.3.0-1) ... 161s Setting up python3.12 (3.12.9-1) ... 162s Setting up libblockdev-loop3:armhf (3.3.0-1) ... 162s Setting up gpgsm (2.4.4-2ubuntu22) ... 162s Setting up libcurl3t64-gnutls:armhf (8.12.0+git20250209.89ed161+ds-1ubuntu1) ... 162s Setting up libglib2.0-bin (2.83.3-2) ... 162s Setting up libpackagekit-glib2-18:armhf (1.3.0-3build1) ... 162s Setting up libappstream5:armhf (1.0.4-1) ... 162s Setting up libqmi-glib5:armhf (1.35.6-1) ... 162s Setting up python3 (3.13.1-1~exp2) ... 163s /usr/bin/py3clean:101: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 163s for fn in glob1(directory, "%s.*" % fname): 163s Setting up linux-headers-generic (6.12.0-15.15+1) ... 163s Setting up binutils (2.44-1ubuntu1) ... 163s Setting up libnetplan1:armhf (1.1.2-2ubuntu1) ... 163s Setting up python3-newt:armhf (0.52.24-4ubuntu1) ... 163s Setting up libblockdev3:armhf (3.3.0-1) ... 163s Setting up fdisk (2.40.2-14ubuntu1) ... 163s Setting up dpkg-dev (1.22.11ubuntu4) ... 163s Setting up libjson-glib-1.0-0:armhf (1.10.6+ds-1) ... 163s Setting up libblockdev-part3:armhf (3.3.0-1) ... 163s Setting up dirmngr (2.4.4-2ubuntu22) ... 163s Setting up gir1.2-packagekitglib-1.0 (1.3.0-3build1) ... 163s Setting up dbus-user-session (1.16.0-1ubuntu1) ... 163s Setting up python3-jinja2 (3.1.5-2) ... 163s Setting up python3-pygments (2.18.0+dfsg-2) ... 165s Setting up python3-chardet (5.2.0+dfsg-2) ... 166s Setting up appstream (1.0.4-1) ... 168s ✔ Metadata cache was updated successfully. 168s Setting up python3-certifi (2025.1.31+ds-1) ... 168s Setting up gir1.2-girepository-2.0:armhf (1.82.0-4) ... 168s Setting up python3-gi (3.50.0-4) ... 168s Setting up python3-idna (3.10-1) ... 169s Setting up xfsprogs (6.12.0-1ubuntu1) ... 169s update-initramfs: deferring update (trigger activated) 169s Setting up keyboxd (2.4.4-2ubuntu22) ... 169s Setting up python3-urllib3 (2.3.0-1) ... 169s Setting up python3-json-pointer (2.4-3) ... 170s Setting up gnupg (2.4.4-2ubuntu22) ... 170s Setting up python3-netplan (1.1.2-2ubuntu1) ... 170s Setting up libpolkit-agent-1-0:armhf (126-2) ... 170s Setting up libgpgme11t64:armhf (1.24.2-1ubuntu1) ... 170s Setting up curl (8.12.0+git20250209.89ed161+ds-1ubuntu1) ... 170s Setting up libvolume-key1:armhf (0.3.12-9) ... 170s Setting up netplan-generator (1.1.2-2ubuntu1) ... 170s Removing 'diversion of /lib/systemd/system-generators/netplan to /lib/systemd/system-generators/netplan.usr-is-merged by netplan-generator' 170s Setting up bind9-host (1:9.20.0-2ubuntu4) ... 170s Setting up python3-distro-info (1.13) ... 170s Setting up polkitd (126-2) ... 171s Setting up python3-more-itertools (10.6.0-1) ... 171s Setting up python3-attr (25.1.0-1) ... 171s Setting up gpg-wks-client (2.4.4-2ubuntu22) ... 171s Setting up libblockdev-crypto3:armhf (3.3.0-1) ... 171s Setting up python3-jwt (2.10.1-2) ... 171s Setting up python3-babel (2.17.0-1) ... 172s Setting up python3-rich (13.9.4-1) ... 172s Setting up python3-gdbm:armhf (3.13.1-1) ... 172s Setting up python3-problem-report (2.31.0-0ubuntu5) ... 172s Setting up python3-apt (2.9.9) ... 173s Setting up python3-jsonpatch (1.32-5) ... 173s Setting up python3-bcrypt (4.2.0-2.1) ... 173s Setting up libqmi-proxy (1.35.6-1) ... 173s Setting up libfwupd3:armhf (2.0.5-1) ... 173s Setting up ufw (0.36.2-9) ... 174s Setting up python3-lazr.uri (1.0.6-5) ... 174s Setting up netplan.io (1.1.2-2ubuntu1) ... 174s Setting up unattended-upgrades (2.12ubuntu3) ... 174s Replacing config file /etc/apt/apt.conf.d/50unattended-upgrades with new version 175s Setting up pollinate (4.33-4ubuntu2) ... 175s Setting up python3-cryptography (43.0.0-1) ... 176s Setting up python3-wadllib (2.0.0-2) ... 176s Setting up bind9-dnsutils (1:9.20.0-2ubuntu4) ... 176s Setting up fwupd (2.0.5-1) ... 176s fwupd-refresh.service is a disabled or a static unit not running, not starting it. 177s fwupd.service is a disabled or a static unit not running, not starting it. 177s Setting up python3-referencing (0.35.1-2ubuntu1) ... 177s Setting up python3-pkg-resources (75.6.0-1) ... 177s Setting up udisks2 (2.10.1-11ubuntu2) ... 177s vda: Failed to write 'change' to '/sys/devices/pci0000:00/0000:00:01.3/0000:04:00.0/virtio2/block/vda/uevent': Permission denied 177s vda1: Failed to write 'change' to '/sys/devices/pci0000:00/0000:00:01.3/0000:04:00.0/virtio2/block/vda/vda1/uevent': Permission denied 177s vda15: Failed to write 'change' to '/sys/devices/pci0000:00/0000:00:01.3/0000:04:00.0/virtio2/block/vda/vda15/uevent': Permission denied 177s vda2: Failed to write 'change' to '/sys/devices/pci0000:00/0000:00:01.3/0000:04:00.0/virtio2/block/vda/vda2/uevent': Permission denied 177s loop0: Failed to write 'change' to '/sys/devices/virtual/block/loop0/uevent': Permission denied 177s loop1: Failed to write 'change' to '/sys/devices/virtual/block/loop1/uevent': Permission denied 177s loop2: Failed to write 'change' to '/sys/devices/virtual/block/loop2/uevent': Permission denied 177s loop3: Failed to write 'change' to '/sys/devices/virtual/block/loop3/uevent': Permission denied 177s loop4: Failed to write 'change' to '/sys/devices/virtual/block/loop4/uevent': Permission denied 177s loop5: Failed to write 'change' to '/sys/devices/virtual/block/loop5/uevent': Permission denied 177s loop6: Failed to write 'change' to '/sys/devices/virtual/block/loop6/uevent': Permission denied 177s loop7: Failed to write 'change' to '/sys/devices/virtual/block/loop7/uevent': Permission denied 177s loop8: Failed to write 'change' to '/sys/devices/virtual/block/loop8/uevent': Permission denied 177s loop9: Failed to write 'change' to '/sys/devices/virtual/block/loop9/uevent': Permission denied 178s Setting up python3-setuptools (75.6.0-1) ... 179s Setting up ubuntu-minimal (1.547) ... 179s Setting up python3-openssl (25.0.0-1) ... 180s Setting up python3-launchpadlib (2.1.0-1) ... 180s Setting up ubuntu-standard (1.547) ... 180s Setting up python3-apport (2.31.0-0ubuntu5) ... 180s Setting up python3-oauthlib (3.2.2-3) ... 181s Setting up python3-software-properties (0.108) ... 181s Setting up python3-jsonschema (4.19.2-6ubuntu1) ... 181s Setting up cloud-init-base (25.1~3geb1965a4-0ubuntu1) ... 181s Installing new version of config file /etc/cloud/templates/sources.list.debian.deb822.tmpl ... 181s Installing new version of config file /etc/cloud/templates/sources.list.ubuntu.deb822.tmpl ... 183s Setting up cloud-init (25.1~3geb1965a4-0ubuntu1) ... 183s Setting up apport-core-dump-handler (2.31.0-0ubuntu5) ... 184s Setting up apport (2.31.0-0ubuntu5) ... 185s apport-autoreport.service is a disabled or a static unit not running, not starting it. 185s Processing triggers for shared-mime-info (2.4-5) ... 185s Warning: program compiled against libxml 212 using older 209 185s Processing triggers for sgml-base (1.31) ... 185s Processing triggers for debianutils (5.21) ... 185s Processing triggers for install-info (7.1.1-1) ... 185s Processing triggers for libc-bin (2.40-4ubuntu1) ... 185s Processing triggers for systemd (257.2-3ubuntu1) ... 186s Processing triggers for man-db (2.13.0-1) ... 187s Setting up packagekit (1.3.0-3build1) ... 187s Setting up packagekit-tools (1.3.0-3build1) ... 187s Setting up software-properties-common (0.108) ... 187s Processing triggers for ca-certificates (20241223) ... 187s Updating certificates in /etc/ssl/certs... 188s 0 added, 0 removed; done. 188s Running hooks in /etc/ca-certificates/update.d... 188s done. 188s Processing triggers for initramfs-tools (0.145ubuntu2) ... 192s Reading package lists... 192s Building dependency tree... 192s Reading state information... 192s Starting pkgProblemResolver with broken count: 0 193s Starting 2 pkgProblemResolver with broken count: 0 193s Done 193s The following packages will be REMOVED: 193s libassuan0* libicu74* libnsl2* libpython3.12-minimal* libpython3.12-stdlib* 193s libunwind8* linux-headers-6.11.0-8* linux-headers-6.11.0-8-generic* 193s python3.12* python3.12-minimal* 194s 0 upgraded, 0 newly installed, 10 to remove and 0 not upgraded. 194s After this operation, 151 MB disk space will be freed. 194s (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 ... 92814 files and directories currently installed.) 194s Removing libassuan0:armhf (2.5.6-1build1) ... 194s Removing libicu74:armhf (74.2-1ubuntu6) ... 194s Removing python3.12 (3.12.9-1) ... 194s Removing libpython3.12-stdlib:armhf (3.12.9-1) ... 194s Removing libnsl2:armhf (1.3.0-3build3) ... 194s Removing python3.12-minimal (3.12.9-1) ... 194s /usr/bin/py3clean:125: DeprecationWarning: glob.glob1 is deprecated and will be removed in Python 3.15. Use glob.glob and pass a directory to its root_dir argument instead. 194s for fn in glob1(directory, "%s.%s.py[co]" % (fname, magic_tag)): 195s Removing libpython3.12-minimal:armhf (3.12.9-1) ... 195s Removing libunwind8:armhf (1.6.2-3.1) ... 195s Removing linux-headers-6.11.0-8-generic (6.11.0-8.8) ... 196s Removing linux-headers-6.11.0-8 (6.11.0-8.8) ... 196s Processing triggers for systemd (257.2-3ubuntu1) ... 197s Processing triggers for man-db (2.13.0-1) ... 197s Processing triggers for libc-bin (2.40-4ubuntu1) ... 197s (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 ... 60358 files and directories currently installed.) 197s Purging configuration files for python3.12-minimal (3.12.9-1) ... 197s Purging configuration files for libpython3.12-minimal:armhf (3.12.9-1) ... 200s autopkgtest [19:31:23]: rebooting testbed after setup commands that affected boot 246s autopkgtest [19:32:09]: testbed running kernel: Linux 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 18:12:14 UTC 2 274s autopkgtest [19:32:37]: @@@@@@@@@@@@@@@@@@@@ apt-source python-inline-snapshot 290s Get:1 http://ftpmaster.internal/ubuntu plucky/universe python-inline-snapshot 0.19.3-1 (dsc) [3233 B] 290s Get:2 http://ftpmaster.internal/ubuntu plucky/universe python-inline-snapshot 0.19.3-1 (tar) [87.9 kB] 290s Get:3 http://ftpmaster.internal/ubuntu plucky/universe python-inline-snapshot 0.19.3-1 (diff) [7508 B] 290s gpgv: Signature made Thu Jan 16 17:58:09 2025 UTC 290s gpgv: using RSA key FC875C834BC71FB6546250A86E25BF686AA7D62A 290s gpgv: issuer "katharasasikumar007@gmail.com" 290s gpgv: Can't check signature: No public key 290s dpkg-source: warning: cannot verify inline signature for ./python-inline-snapshot_0.19.3-1.dsc: no acceptable signature found 290s autopkgtest [19:32:53]: testing package python-inline-snapshot version 0.19.3-1 293s autopkgtest [19:32:56]: build not needed 296s autopkgtest [19:32:59]: test upstream-tests: preparing testbed 298s Reading package lists... 298s Building dependency tree... 298s Reading state information... 298s Starting pkgProblemResolver with broken count: 0 299s Starting 2 pkgProblemResolver with broken count: 0 299s Done 299s The following NEW packages will be installed: 299s black libnsl2 libpython3.12-minimal libpython3.12-stdlib 299s python-inline-snapshot-doc python3-all python3-annotated-types 299s python3-asttokens python3-click python3-dateutil python3-dirty-equals 299s python3-dnspython python3-email-validator python3-executing 299s python3-freezegun python3-hypothesis python3-iniconfig 299s python3-inline-snapshot python3-mypy-extensions python3-packaging 299s python3-pathspec python3-platformdirs python3-pluggy python3-pydantic 299s python3-pydantic-core python3-pytest python3-pytest-freezer 299s python3-pytest-mock python3-pytest-subtests python3-sortedcontainers 299s python3-time-machine python3.12 python3.12-minimal 300s 0 upgraded, 33 newly installed, 0 to remove and 0 not upgraded. 300s Need to get 5726 kB/11.2 MB of archives. 300s After this operation, 54.3 MB of additional disk space will be used. 300s Get:1 http://ftpmaster.internal/ubuntu plucky/main armhf libnsl2 armhf 1.3.0-3build3 [36.5 kB] 300s Get:2 http://ftpmaster.internal/ubuntu plucky-proposed/main armhf python3-click all 8.2.0-1 [81.9 kB] 300s Get:3 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-mypy-extensions all 1.0.0-1 [6148 B] 300s Get:4 http://ftpmaster.internal/ubuntu plucky/main armhf python3-packaging all 24.2-1 [51.5 kB] 300s Get:5 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-pathspec all 0.12.1-1 [24.5 kB] 300s Get:6 http://ftpmaster.internal/ubuntu plucky/main armhf python3-platformdirs all 4.3.6-1 [16.8 kB] 300s Get:7 http://ftpmaster.internal/ubuntu plucky/universe armhf black armhf 25.1.0-1 [1856 kB] 300s Get:8 http://ftpmaster.internal/ubuntu plucky/universe armhf python-inline-snapshot-doc all 0.19.3-1 [541 kB] 300s Get:9 http://ftpmaster.internal/ubuntu plucky/main armhf python3-all armhf 3.13.1-1~exp2 [896 B] 300s Get:10 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-annotated-types all 0.7.0-1 [19.4 kB] 300s Get:11 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-asttokens all 3.0.0-1 [20.4 kB] 300s Get:12 http://ftpmaster.internal/ubuntu plucky/main armhf python3-dateutil all 2.9.0-3 [80.2 kB] 300s Get:13 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-dirty-equals all 0.9.0-1 [23.2 kB] 300s Get:14 http://ftpmaster.internal/ubuntu plucky/main armhf python3-dnspython all 2.7.0-1ubuntu1 [167 kB] 300s Get:15 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-email-validator all 2.2.0-1 [28.5 kB] 300s Get:16 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-executing all 2.2.0-0.1 [25.0 kB] 300s Get:17 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-freezegun all 1.5.1-1.2 [15.9 kB] 300s Get:18 http://ftpmaster.internal/ubuntu plucky/main armhf python3-sortedcontainers all 2.4.0-2 [27.6 kB] 300s Get:19 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-hypothesis all 6.125.2-1 [333 kB] 300s Get:20 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-iniconfig all 1.1.1-2 [6024 B] 300s Get:21 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-inline-snapshot all 0.19.3-1 [32.5 kB] 300s Get:22 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-pluggy all 1.5.0-1 [21.0 kB] 300s Get:23 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-pydantic-core armhf 2.27.2-1 [1721 kB] 301s Get:24 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-pydantic armhf 2.10.6-1 [288 kB] 301s Get:25 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-pytest all 8.3.4-1 [252 kB] 301s Get:26 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-pytest-freezer all 0.4.9-1 [4542 B] 301s Get:27 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-pytest-mock all 3.14.0-2 [11.7 kB] 301s Get:28 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-pytest-subtests all 0.13.1-1 [10.8 kB] 301s Get:29 http://ftpmaster.internal/ubuntu plucky/universe armhf python3-time-machine armhf 2.16.0-1 [23.9 kB] 301s Fetched 5726 kB in 1s (4938 kB/s) 301s Selecting previously unselected package libpython3.12-minimal:armhf. 301s (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 ... 60356 files and directories currently installed.) 301s Preparing to unpack .../00-libpython3.12-minimal_3.12.9-1_armhf.deb ... 301s Unpacking libpython3.12-minimal:armhf (3.12.9-1) ... 301s Selecting previously unselected package python3.12-minimal. 301s Preparing to unpack .../01-python3.12-minimal_3.12.9-1_armhf.deb ... 301s Unpacking python3.12-minimal (3.12.9-1) ... 301s Selecting previously unselected package libnsl2:armhf. 301s Preparing to unpack .../02-libnsl2_1.3.0-3build3_armhf.deb ... 301s Unpacking libnsl2:armhf (1.3.0-3build3) ... 301s Selecting previously unselected package libpython3.12-stdlib:armhf. 301s Preparing to unpack .../03-libpython3.12-stdlib_3.12.9-1_armhf.deb ... 301s Unpacking libpython3.12-stdlib:armhf (3.12.9-1) ... 301s Selecting previously unselected package python3.12. 301s Preparing to unpack .../04-python3.12_3.12.9-1_armhf.deb ... 301s Unpacking python3.12 (3.12.9-1) ... 302s Selecting previously unselected package python3-click. 302s Preparing to unpack .../05-python3-click_8.2.0-1_all.deb ... 302s Unpacking python3-click (8.2.0-1) ... 302s Selecting previously unselected package python3-mypy-extensions. 302s Preparing to unpack .../06-python3-mypy-extensions_1.0.0-1_all.deb ... 302s Unpacking python3-mypy-extensions (1.0.0-1) ... 302s Selecting previously unselected package python3-packaging. 302s Preparing to unpack .../07-python3-packaging_24.2-1_all.deb ... 302s Unpacking python3-packaging (24.2-1) ... 302s Selecting previously unselected package python3-pathspec. 302s Preparing to unpack .../08-python3-pathspec_0.12.1-1_all.deb ... 302s Unpacking python3-pathspec (0.12.1-1) ... 302s Selecting previously unselected package python3-platformdirs. 302s Preparing to unpack .../09-python3-platformdirs_4.3.6-1_all.deb ... 302s Unpacking python3-platformdirs (4.3.6-1) ... 302s Selecting previously unselected package black. 302s Preparing to unpack .../10-black_25.1.0-1_armhf.deb ... 302s Unpacking black (25.1.0-1) ... 302s Selecting previously unselected package python-inline-snapshot-doc. 302s Preparing to unpack .../11-python-inline-snapshot-doc_0.19.3-1_all.deb ... 302s Unpacking python-inline-snapshot-doc (0.19.3-1) ... 302s Selecting previously unselected package python3-all. 302s Preparing to unpack .../12-python3-all_3.13.1-1~exp2_armhf.deb ... 302s Unpacking python3-all (3.13.1-1~exp2) ... 302s Selecting previously unselected package python3-annotated-types. 302s Preparing to unpack .../13-python3-annotated-types_0.7.0-1_all.deb ... 302s Unpacking python3-annotated-types (0.7.0-1) ... 302s Selecting previously unselected package python3-asttokens. 302s Preparing to unpack .../14-python3-asttokens_3.0.0-1_all.deb ... 302s Unpacking python3-asttokens (3.0.0-1) ... 302s Selecting previously unselected package python3-dateutil. 302s Preparing to unpack .../15-python3-dateutil_2.9.0-3_all.deb ... 302s Unpacking python3-dateutil (2.9.0-3) ... 302s Selecting previously unselected package python3-dirty-equals. 302s Preparing to unpack .../16-python3-dirty-equals_0.9.0-1_all.deb ... 302s Unpacking python3-dirty-equals (0.9.0-1) ... 302s Selecting previously unselected package python3-dnspython. 302s Preparing to unpack .../17-python3-dnspython_2.7.0-1ubuntu1_all.deb ... 302s Unpacking python3-dnspython (2.7.0-1ubuntu1) ... 302s Selecting previously unselected package python3-email-validator. 302s Preparing to unpack .../18-python3-email-validator_2.2.0-1_all.deb ... 302s Unpacking python3-email-validator (2.2.0-1) ... 302s Selecting previously unselected package python3-executing. 302s Preparing to unpack .../19-python3-executing_2.2.0-0.1_all.deb ... 302s Unpacking python3-executing (2.2.0-0.1) ... 302s Selecting previously unselected package python3-freezegun. 302s Preparing to unpack .../20-python3-freezegun_1.5.1-1.2_all.deb ... 302s Unpacking python3-freezegun (1.5.1-1.2) ... 302s Selecting previously unselected package python3-sortedcontainers. 302s Preparing to unpack .../21-python3-sortedcontainers_2.4.0-2_all.deb ... 302s Unpacking python3-sortedcontainers (2.4.0-2) ... 302s Selecting previously unselected package python3-hypothesis. 302s Preparing to unpack .../22-python3-hypothesis_6.125.2-1_all.deb ... 302s Unpacking python3-hypothesis (6.125.2-1) ... 302s Selecting previously unselected package python3-iniconfig. 302s Preparing to unpack .../23-python3-iniconfig_1.1.1-2_all.deb ... 302s Unpacking python3-iniconfig (1.1.1-2) ... 302s Selecting previously unselected package python3-inline-snapshot. 302s Preparing to unpack .../24-python3-inline-snapshot_0.19.3-1_all.deb ... 302s Unpacking python3-inline-snapshot (0.19.3-1) ... 302s Selecting previously unselected package python3-pluggy. 302s Preparing to unpack .../25-python3-pluggy_1.5.0-1_all.deb ... 302s Unpacking python3-pluggy (1.5.0-1) ... 302s Selecting previously unselected package python3-pydantic-core. 302s Preparing to unpack .../26-python3-pydantic-core_2.27.2-1_armhf.deb ... 302s Unpacking python3-pydantic-core (2.27.2-1) ... 302s Selecting previously unselected package python3-pydantic. 303s Preparing to unpack .../27-python3-pydantic_2.10.6-1_armhf.deb ... 303s Unpacking python3-pydantic (2.10.6-1) ... 303s Selecting previously unselected package python3-pytest. 303s Preparing to unpack .../28-python3-pytest_8.3.4-1_all.deb ... 303s Unpacking python3-pytest (8.3.4-1) ... 303s Selecting previously unselected package python3-pytest-freezer. 303s Preparing to unpack .../29-python3-pytest-freezer_0.4.9-1_all.deb ... 303s Unpacking python3-pytest-freezer (0.4.9-1) ... 303s Selecting previously unselected package python3-pytest-mock. 303s Preparing to unpack .../30-python3-pytest-mock_3.14.0-2_all.deb ... 303s Unpacking python3-pytest-mock (3.14.0-2) ... 303s Selecting previously unselected package python3-pytest-subtests. 303s Preparing to unpack .../31-python3-pytest-subtests_0.13.1-1_all.deb ... 303s Unpacking python3-pytest-subtests (0.13.1-1) ... 303s Selecting previously unselected package python3-time-machine. 303s Preparing to unpack .../32-python3-time-machine_2.16.0-1_armhf.deb ... 303s Unpacking python3-time-machine (2.16.0-1) ... 303s Setting up python3-iniconfig (1.1.1-2) ... 303s Setting up python3-pydantic-core (2.27.2-1) ... 303s Setting up python3-asttokens (3.0.0-1) ... 303s Setting up python3-mypy-extensions (1.0.0-1) ... 304s Setting up python3-dirty-equals (0.9.0-1) ... 304s Setting up libpython3.12-minimal:armhf (3.12.9-1) ... 304s Setting up python3-sortedcontainers (2.4.0-2) ... 304s Setting up python3-click (8.2.0-1) ... 304s Setting up python3-annotated-types (0.7.0-1) ... 304s Setting up python3-platformdirs (4.3.6-1) ... 305s Setting up python3-packaging (24.2-1) ... 305s Setting up python3-executing (2.2.0-0.1) ... 305s Setting up python3-pluggy (1.5.0-1) ... 305s Setting up python3-dnspython (2.7.0-1ubuntu1) ... 306s Setting up libnsl2:armhf (1.3.0-3build3) ... 306s Setting up python3-dateutil (2.9.0-3) ... 306s Setting up python3-email-validator (2.2.0-1) ... 306s Setting up python-inline-snapshot-doc (0.19.3-1) ... 306s Setting up python3-pathspec (0.12.1-1) ... 307s Setting up python3-freezegun (1.5.1-1.2) ... 307s Setting up python3.12-minimal (3.12.9-1) ... 308s Setting up libpython3.12-stdlib:armhf (3.12.9-1) ... 308s Setting up python3-pytest (8.3.4-1) ... 308s Setting up python3.12 (3.12.9-1) ... 309s Setting up python3-hypothesis (6.125.2-1) ... 310s Setting up python3-all (3.13.1-1~exp2) ... 310s Setting up black (25.1.0-1) ... 311s Setting up python3-time-machine (2.16.0-1) ... 311s Setting up python3-inline-snapshot (0.19.3-1) ... 311s Setting up python3-pydantic (2.10.6-1) ... 312s Setting up python3-pytest-freezer (0.4.9-1) ... 312s Setting up python3-pytest-mock (3.14.0-2) ... 312s Setting up python3-pytest-subtests (0.13.1-1) ... 312s Processing triggers for systemd (257.2-3ubuntu1) ... 312s Processing triggers for man-db (2.13.0-1) ... 313s Processing triggers for libc-bin (2.40-4ubuntu1) ... 324s autopkgtest [19:33:27]: test upstream-tests: [----------------------- 326s 326s *************************** 326s *** Testing with python3.12 326s *************************** 326s 326s Content of current working folder: 326s 326s total 0 326s drwxr-xr-x 1 ubuntu ubuntu 10 Feb 19 19:33 . 326s drwxrwxrwt 1 root root 530 Feb 19 19:33 .. 326s drwxrwxr-x 1 ubuntu ubuntu 872 Jan 15 18:43 tests 326s Running tests... 326s 328s ============================= test session starts ============================== 328s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 328s rootdir: /tmp/autopkgtest.NQN92o/autopkgtest_tmp 328s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 328s collected 392 items / 10 deselected / 382 selected 328s 336s tests/adapter/test_dataclass.py FFFFEFE.FF.F.FEFEFEFF [ 4%] 336s tests/adapter/test_dict.py F [ 4%] 337s tests/adapter/test_general.py F. [ 4%] 337s tests/adapter/test_sequence.py FF..F [ 6%] 337s tests/test_align.py . [ 6%] 337s tests/test_change.py F [ 6%] 339s tests/test_code_repr.py FF.FFFF.............................F [ 16%] 344s tests/test_config.py FEFEFEFE [ 17%] 344s tests/test_dirty_equals.py xF..F [ 18%] 344s tests/test_docs.py .s [ 19%] 345s tests/test_example.py FE [ 19%] 358s tests/test_external.py F..FFFFFFF..FFFF [ 23%] 360s tests/test_formating.py FF.. [ 24%] 360s tests/test_fstring.py .. [ 25%] 360s tests/test_hasrepr.py . [ 25%] 361s tests/test_inline_snapshot.py ..uuuuuuuuuuuuuuuuuuuuuuuuuuuuuu.,,,,,,,,, [ 26%] 364s ,,,,,,,,,,,,,,,,,,,,,.FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 39%] 367s FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF,,.,,.,,,.,,.,,., [ 55%] 367s ,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,, [ 61%] 367s .,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,. [ 67%] 368s ,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,.,, [ 73%] 368s ,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,,.,,. [ 79%] 369s ,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,.FFFFFFF...FF.FFFF..F [ 86%] 369s tests/test_is.py F [ 87%] 369s tests/test_is_normalized.py F [ 87%] 371s tests/test_preserve_values.py FFFFFFFFFFuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu [ 90%] 374s uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu,uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu [ 90%] 377s uuuuuuuuuuuuuuuuuuuuuuu,uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu [ 90%] 377s uuuuuuuuuuuuuuu,. [ 90%] 383s tests/test_pydantic.py FEFEFE.FE [ 91%] 384s tests/test_pypy.py F [ 91%] 406s tests/test_pytest_plugin.py .FFFFF.FFFFF.F.FFF..FFFE [ 97%] 406s tests/test_raises.py . [ 98%] 406s tests/test_rewrite_code.py .F [ 98%] 408s tests/test_string.py FFF. [ 99%] 408s tests/test_warns.py . [100%] 408s 408s ==================================== ERRORS ==================================== 408s ________________ ERROR at teardown of test_attrs_default_value _________________ 408s some snapshots in this test have incorrect values. 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot,Is 408s import attrs 408s 408s @attrs.define 408s class A: 408s a:int 408s b:int=2 408s c:list=attrs.field(factory=list) 408s d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) 408s 408s def test_something(): 408s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 408s assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) 408s 408s 408s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 408s stdout: 408s ============================= test session starts ============================== 408s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/tmp2j48lme8 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_something.py F [100%] 408s 408s =================================== FAILURES =================================== 408s ________________________________ test_something ________________________________ 408s 408s def test_something(): 408s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 408s > assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) 408s 408s test_something.py:13: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:194: in assign 408s result_kwargs[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '2 ', filename = PosixPath('/tmp/tmp2j48lme8/test_something.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_something.py::test_something - TypeError: CliRunner.__init__() go... 408s ============================== 1 failed in 0.28s =============================== 408s 408s stderr: 408s 408s __________________ ERROR at teardown of test_attrs_field_repr __________________ 408s some snapshots in this test have incorrect values. 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot 408s import attrs 408s 408s @attrs.define 408s class container: 408s a: int 408s b: int = attrs.field(default=5,repr=False) 408s 408s assert container(a=1,b=5) == snapshot() 408s 408s 408s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 408s stdout: 408s ============================= test session starts ============================== 408s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/tmpbubh3c8e 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 0 items / 1 error 408s 408s ==================================== ERRORS ==================================== 408s ______________________ ERROR collecting test_something.py ______________________ 408s test_something.py:9: in 408s assert container(a=1,b=5) == snapshot() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 408s runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s ERROR test_something.py - TypeError: CliRunner.__init__() got an unexpected k... 408s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 408s =============================== 1 error in 0.38s =============================== 408s 408s stderr: 408s 408s _____________ ERROR at teardown of test_remove_positional_argument _____________ 408s some snapshots in this test have incorrect values. 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot 408s 408s from inline_snapshot._adapter.generic_call_adapter import GenericCallAdapter,Argument 408s 408s 408s class L: 408s def __init__(self,*l): 408s self.l=l 408s 408s def __eq__(self,other): 408s if not isinstance(other,L): 408s return NotImplemented 408s return other.l==self.l 408s 408s class LAdapter(GenericCallAdapter): 408s @classmethod 408s def check_type(cls, typ): 408s return issubclass(typ,L) 408s 408s @classmethod 408s def arguments(cls, value): 408s return ([Argument(x) for x in value.l],{}) 408s 408s @classmethod 408s def argument(cls, value, pos_or_name): 408s assert isinstance(pos_or_name,int) 408s return value.l[pos_or_name] 408s 408s def test_L1(): 408s assert L(1,2) == snapshot(L(1)), "not equal" 408s 408s def test_L2(): 408s assert L(1,2) == snapshot(L(1, 2, 3)), "not equal" 408s 408s 408s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 408s stdout: 408s ============================= test session starts ============================== 408s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/tmpfdrv_ghf 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 2 items 408s 408s test_something.py F. [100%] 408s 408s =================================== FAILURES =================================== 408s ___________________________________ test_L1 ____________________________________ 408s 408s def test_L1(): 408s > assert L(1,2) == snapshot(L(1)), "not equal" 408s 408s test_something.py:30: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:162: in assign 408s new_code=self.context.file._value_to_code(value.value), 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '2 ', filename = PosixPath('/tmp/tmpfdrv_ghf/test_something.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s ──────────────────────────────── Fix snapshots ───────────────────────────────── 408s =========================== short test summary info ============================ 408s FAILED test_something.py::test_L1 - TypeError: CliRunner.__init__() got an un... 408s 408s stderr: 408s Traceback (most recent call last): 408s File "", line 198, in _run_module_as_main 408s File "", line 88, in _run_code 408s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 408s raise SystemExit(pytest.console_main()) 408s ^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 408s code = main() 408s ^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 408s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 408s res = hook_impl.function(*args) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 408s return wrap_session(config, _main) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 408s config.hook.pytest_sessionfinish( 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 408s teardown.send(result) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 408s self.config.hook.pytest_terminal_summary( 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 408s res = hook_impl.function(*args) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary 408s diff = file.diff() 408s ^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff 408s unified_diff(self.source.splitlines(), self.new_code().splitlines()), 408s ^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code 408s format_whole_file = enforce_formatting() or code == format_code( 408s ^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s _____________________ ERROR at teardown of test_namedtuple _____________________ 408s some snapshots in this test have incorrect values. 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot 408s from collections import namedtuple 408s 408s T=namedtuple("T","a,b") 408s 408s def test_tuple(): 408s assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" 408s 408s 408s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 408s stdout: 408s ============================= test session starts ============================== 408s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/tmpnn6lf1wr 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_something.py F [100%] 408s 408s =================================== FAILURES =================================== 408s __________________________________ test_tuple __________________________________ 408s 408s def test_tuple(): 408s > assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" 408s 408s test_something.py:7: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:194: in assign 408s result_kwargs[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '2 ', filename = PosixPath('/tmp/tmpnn6lf1wr/test_something.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_something.py::test_tuple - TypeError: CliRunner.__init__() got an... 408s ============================== 1 failed in 0.27s =============================== 408s 408s stderr: 408s 408s ____________________ ERROR at teardown of test_defaultdict _____________________ 408s some snapshots in this test have incorrect values. 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot 408s from collections import defaultdict 408s 408s 408s def test_tuple(): 408s d=defaultdict(list) 408s d[1].append(2) 408s assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" 408s 408s 408s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 408s stdout: 408s ============================= test session starts ============================== 408s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/tmpxhw0f9ea 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_something.py F [100%] 408s 408s =================================== FAILURES =================================== 408s __________________________________ test_tuple __________________________________ 408s 408s def test_tuple(): 408s d=defaultdict(list) 408s d[1].append(2) 408s > assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" 408s 408s test_something.py:8: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:140: in assign 408s result = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '2 ', filename = PosixPath('/tmp/tmpxhw0f9ea/test_something.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_something.py::test_tuple - TypeError: CliRunner.__init__() got an... 408s ============================== 1 failed in 0.30s =============================== 408s 408s stderr: 408s 408s __________________ ERROR at teardown of test_config_pyproject __________________ 408s some snapshots in this test have incorrect values. 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_a.py 408s from inline_snapshot import snapshot 408s 408s def test_a(): 408s assert 1 <= snapshot(5) 408s assert 1 == snapshot(2) 408s 408s 408s file: pyproject.toml 408s 408s [tool.inline-snapshot] 408s default-flags = ["trim"] 408s 408s 408s run> /usr/bin/python3.12 -m pytest 408s stdout: 408s ============================= test session starts ============================== 408s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/tmpg9urbp5h 408s configfile: pyproject.toml 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_a.py F [100%] 408s 408s =================================== FAILURES =================================== 408s ____________________________________ test_a ____________________________________ 408s 408s def test_a(): 408s assert 1 <= snapshot(5) 408s > assert 1 == snapshot(2) 408s 408s test_a.py:5: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '1 ', filename = PosixPath('/tmp/tmpg9urbp5h/test_a.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 408s 408s stderr: 408s Traceback (most recent call last): 408s File "", line 198, in _run_module_as_main 408s File "", line 88, in _run_code 408s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 408s raise SystemExit(pytest.console_main()) 408s ^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 408s code = main() 408s ^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 408s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 408s res = hook_impl.function(*args) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 408s return wrap_session(config, _main) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 408s config.hook.pytest_sessionfinish( 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 408s teardown.send(result) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 408s self.config.hook.pytest_terminal_summary( 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 408s res = hook_impl.function(*args) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 408s for change in snapshot._changes(): 408s ^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 408s yield from self._value._get_changes() 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s _____________________ ERROR at teardown of test_config_env _____________________ 408s some snapshots in this test have incorrect values. 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_a.py 408s from inline_snapshot import snapshot 408s 408s def test_a(): 408s assert 1 <= snapshot(5) 408s assert 1 == snapshot(2) 408s 408s 408s run> /usr/bin/python3.12 -m pytest 408s stdout: 408s ============================= test session starts ============================== 408s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/tmp5rohqogv 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_a.py F [100%] 408s 408s =================================== FAILURES =================================== 408s ____________________________________ test_a ____________________________________ 408s 408s def test_a(): 408s assert 1 <= snapshot(5) 408s > assert 1 == snapshot(2) 408s 408s test_a.py:5: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '1 ', filename = PosixPath('/tmp/tmp5rohqogv/test_a.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 408s 408s stderr: 408s Traceback (most recent call last): 408s File "", line 198, in _run_module_as_main 408s File "", line 88, in _run_code 408s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 408s raise SystemExit(pytest.console_main()) 408s ^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 408s code = main() 408s ^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 408s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 408s res = hook_impl.function(*args) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 408s return wrap_session(config, _main) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 408s config.hook.pytest_sessionfinish( 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 408s teardown.send(result) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 408s self.config.hook.pytest_terminal_summary( 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 408s res = hook_impl.function(*args) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 408s for change in snapshot._changes(): 408s ^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 408s yield from self._value._get_changes() 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s _____________________ ERROR at teardown of test_shortcuts ______________________ 408s some snapshots in this test have incorrect values. 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_a.py 408s from inline_snapshot import snapshot 408s 408s def test_a(): 408s assert 1 <= snapshot(5) 408s assert 1 == snapshot(2) 408s 408s 408s file: pyproject.toml 408s 408s [tool.inline-snapshot.shortcuts] 408s strim=["trim"] 408s 408s 408s run> /usr/bin/python3.12 -m pytest --strim 408s stdout: 408s ============================= test session starts ============================== 408s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/tmpnyfw7ktr 408s configfile: pyproject.toml 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_a.py F [100%] 408s 408s =================================== FAILURES =================================== 408s ____________________________________ test_a ____________________________________ 408s 408s def test_a(): 408s assert 1 <= snapshot(5) 408s > assert 1 == snapshot(2) 408s 408s test_a.py:5: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '1 ', filename = PosixPath('/tmp/tmpnyfw7ktr/test_a.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 408s 408s stderr: 408s Traceback (most recent call last): 408s File "", line 198, in _run_module_as_main 408s File "", line 88, in _run_code 408s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 408s raise SystemExit(pytest.console_main()) 408s ^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 408s code = main() 408s ^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 408s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 408s res = hook_impl.function(*args) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 408s return wrap_session(config, _main) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 408s config.hook.pytest_sessionfinish( 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 408s teardown.send(result) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 408s self.config.hook.pytest_terminal_summary( 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 408s res = hook_impl.function(*args) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 408s for change in snapshot._changes(): 408s ^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 408s yield from self._value._get_changes() 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s _________________ ERROR at teardown of test_default_shortcuts __________________ 408s some snapshots in this test have incorrect values. 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_a.py 408s from inline_snapshot import snapshot 408s 408s def test_a(): 408s assert 1 <= snapshot(5) 408s assert 1 == snapshot(2) 408s 408s 408s file: pyproject.toml 408s 408s 408s 408s run> /usr/bin/python3.12 -m pytest --fix 408s stdout: 408s ============================= test session starts ============================== 408s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/tmpziow45_8 408s configfile: pyproject.toml 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_a.py F [100%] 408s 408s =================================== FAILURES =================================== 408s ____________________________________ test_a ____________________________________ 408s 408s def test_a(): 408s assert 1 <= snapshot(5) 408s > assert 1 == snapshot(2) 408s 408s test_a.py:5: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '1 ', filename = PosixPath('/tmp/tmpziow45_8/test_a.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 408s 408s stderr: 408s Traceback (most recent call last): 408s File "", line 198, in _run_module_as_main 408s File "", line 88, in _run_code 408s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 408s raise SystemExit(pytest.console_main()) 408s ^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 408s code = main() 408s ^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 408s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 408s res = hook_impl.function(*args) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 408s return wrap_session(config, _main) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 408s config.hook.pytest_sessionfinish( 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 408s teardown.send(result) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 408s self.config.hook.pytest_terminal_summary( 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 408s res = hook_impl.function(*args) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 408s for change in snapshot._changes(): 408s ^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 408s yield from self._value._get_changes() 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s ______________________ ERROR at teardown of test_example _______________________ 408s some snapshots in this test have incorrect values. 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_a.py 408s 408s from inline_snapshot import snapshot 408s 408s def test_a(): 408s assert 1==snapshot(2) 408s 408s 408s file: test_b.py 408s 1+1 408s 408s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create,fix 408s stdout: 408s ============================= test session starts ============================== 408s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/tmpda072882 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_a.py F [100%] 408s 408s =================================== FAILURES =================================== 408s ____________________________________ test_a ____________________________________ 408s 408s def test_a(): 408s > assert 1==snapshot(2) 408s 408s test_a.py:5: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '1 ', filename = PosixPath('/tmp/tmpda072882/test_a.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 408s ============================== 1 failed in 0.26s =============================== 408s 408s stderr: 408s 408s file: test_a.py 408s 408s from inline_snapshot import snapshot 408s 408s def test_a(): 408s assert 1==snapshot(2) 408s 408s 408s file: test_b.py 408s 1+1 408s 408s run> pytest /tmp/tmpzk83f4nw/test_a.py 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 408s v() 408s File "/tmp/tmpzk83f4nw/test_a.py", line 5, in test_a 408s assert 1==snapshot(2) 408s ^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 408s return self == other 408s ^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 408s self._changes.append(next(it)) 408s ^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 408s new_code = self.context.file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s ______________ ERROR at teardown of test_pydantic_create_snapshot ______________ 408s some snapshots in this test have incorrect values. 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s 408s from pydantic import BaseModel 408s from inline_snapshot import snapshot 408s 408s class M(BaseModel): 408s size:int 408s name:str 408s age:int=4 408s 408s def test_pydantic(): 408s m=M(size=5,name="Tom") 408s assert m==snapshot() 408s assert m.dict()==snapshot() 408s 408s 408s 408s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 408s stdout: 408s ============================= test session starts ============================== 408s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/tmpkce4hm02 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_something.py F [100%] 408s 408s =================================== FAILURES =================================== 408s ________________________________ test_pydantic _________________________________ 408s 408s def test_pydantic(): 408s m=M(size=5,name="Tom") 408s > assert m==snapshot() 408s 408s test_something.py:12: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '', filename = PosixPath('/tmp/tmpkce4hm02/test_something.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_something.py::test_pydantic - TypeError: CliRunner.__init__() got... 408s ============================== 1 failed in 0.31s =============================== 408s 408s stderr: 408s 408s ________________ ERROR at teardown of test_pydantic_field_repr _________________ 408s some snapshots in this test have incorrect values. 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot 408s from pydantic import BaseModel,Field 408s 408s class container(BaseModel): 408s a: int 408s b: int = Field(default=5,repr=False) 408s 408s assert container(a=1,b=5) == snapshot() 408s 408s 408s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 408s stdout: 408s ============================= test session starts ============================== 408s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/tmpjk66v2b8 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 0 items / 1 error 408s 408s ==================================== ERRORS ==================================== 408s ______________________ ERROR collecting test_something.py ______________________ 408s test_something.py:8: in 408s assert container(a=1,b=5) == snapshot() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 408s runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s ERROR test_something.py - TypeError: CliRunner.__init__() got an unexpected k... 408s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 408s =============================== 1 error in 0.39s =============================== 408s 408s stderr: 408s 408s _______________ ERROR at teardown of test_pydantic_default_value _______________ 408s some snapshots in this test have incorrect values. 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot,Is 408s from dataclasses import dataclass,field 408s from pydantic import BaseModel,Field 408s 408s class A(BaseModel): 408s a:int 408s b:int=2 408s c:list=Field(default_factory=list) 408s 408s def test_something(): 408s assert A(a=1) == snapshot(A(a=1,b=2,c=[])) 408s 408s 408s run> /usr/bin/python3.12 -m pytest --inline-snapshot=update 408s stdout: 408s ============================= test session starts ============================== 408s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/tmpzg0_1664 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_something.py . [100%] 408s =============================== inline snapshot ================================ 408s ─────────────────────────────── Update snapshots ─────────────────────────────── 408s 408s stderr: 408s Traceback (most recent call last): 408s File "", line 198, in _run_module_as_main 408s File "", line 88, in _run_code 408s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 408s raise SystemExit(pytest.console_main()) 408s ^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 408s code = main() 408s ^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 408s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 408s res = hook_impl.function(*args) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 408s return wrap_session(config, _main) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 408s config.hook.pytest_sessionfinish( 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 408s teardown.send(result) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 408s self.config.hook.pytest_terminal_summary( 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 408s res = hook_impl.function(*args) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary 408s diff = file.diff() 408s ^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff 408s unified_diff(self.source.splitlines(), self.new_code().splitlines()), 408s ^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code 408s format_whole_file = enforce_formatting() or code == format_code( 408s ^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s ______________ ERROR at teardown of test_pydantic_factory_method _______________ 408s some snapshots in this test have incorrect values. 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot 408s from pydantic import BaseModel 408s 408s class A(BaseModel): 408s a:int 408s 408s @classmethod 408s def from_str(cls,s): 408s return cls(a=int(s)) 408s 408s def test_something(): 408s for a in [1,2]: 408s assert A(a=2) == snapshot(A.from_str("1")) 408s 408s 408s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 408s stdout: 408s ============================= test session starts ============================== 408s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/tmpkc28j5kk 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_something.py F [100%] 408s 408s =================================== FAILURES =================================== 408s ________________________________ test_something ________________________________ 408s 408s def test_something(): 408s for a in [1,2]: 408s > assert A(a=2) == snapshot(A.from_str("1")) 408s 408s test_something.py:13: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:107: in assign 408s result = yield from self.value_assign(old_value, old_node, new_value) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py:87: in value_assign 408s result = yield from adapter.assign(old_value, old_node, new_value) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = 'A (a =2 )', filename = PosixPath('/tmp/tmpkc28j5kk/test_something.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_something.py::test_something - TypeError: CliRunner.__init__() go... 408s ============================== 1 failed in 0.32s =============================== 408s 408s stderr: 408s 408s ________ ERROR at teardown of test_find_pyproject_in_parent_directories ________ 408s some snapshots in this test have incorrect values. 408s ----------------------------- Captured stdout call ----------------------------- 408s file: pyproject.toml 408s [tool.inline-snapshot] 408s hash-length=2 408s 408s 408s file: project/pytest.ini 408s 408s 408s file: project/test_something.py 408s from inline_snapshot import outsource,snapshot,external 408s 408s def test_something(): 408s assert outsource("test") == snapshot() 408s 408s 408s run> /usr/bin/python3.12 -m pytest --rootdir ./project --inline-snapshot=create 408s stdout: 408s ============================= test session starts ============================== 408s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/tmpgcxai5vd/project 408s configfile: ../pyproject.toml 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s project/test_something.py F [100%] 408s 408s =================================== FAILURES =================================== 408s ________________________________ test_something ________________________________ 408s 408s def test_something(): 408s > assert outsource("test") == snapshot() 408s 408s project/test_something.py:4: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '', filename = PosixPath('/tmp/tmpgcxai5vd/project/test_something.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED project/test_something.py::test_something - TypeError: CliRunner.__ini... 408s ============================== 1 failed in 0.26s =============================== 408s 408s stderr: 408s 408s =================================== FAILURES =================================== 408s ________________________________ test_unmanaged ________________________________ 408s 408s def test_unmanaged(): 408s 408s Example( 408s """\ 408s from inline_snapshot import snapshot,Is 408s from dataclasses import dataclass 408s 408s @dataclass 408s class A: 408s a:int 408s b:int 408s 408s def test_something(): 408s assert A(a=2,b=4) == snapshot(A(a=1,b=Is(1))), "not equal" 408s """ 408s > ).run_inline( 408s ["--inline-snapshot=fix"], 408s changed_files=snapshot( 408s { 408s "test_something.py": """\ 408s from inline_snapshot import snapshot,Is 408s from dataclasses import dataclass 408s 408s @dataclass 408s class A: 408s a:int 408s b:int 408s 408s def test_something(): 408s assert A(a=2,b=4) == snapshot(A(a=2,b=Is(1))), "not equal" 408s """ 408s } 408s ), 408s raises=snapshot( 408s """\ 408s AssertionError: 408s not equal\ 408s """ 408s ), 408s ) 408s 408s tests/adapter/test_dataclass.py:21: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 408s assert raises == f"{type(raised_exception).__name__}:\n" + str( 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 408s filename = PosixPath('/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/adapter/test_dataclass.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot,Is 408s from dataclasses import dataclass 408s 408s @dataclass 408s class A: 408s a:int 408s b:int 408s 408s def test_something(): 408s assert A(a=2,b=4) == snapshot(A(a=1,b=Is(1))), "not equal" 408s 408s 408s run> pytest /tmp/tmpr5kwn_sd/test_something.py 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 408s v() 408s File "/tmp/tmpr5kwn_sd/test_something.py", line 10, in test_something 408s assert A(a=2,b=4) == snapshot(A(a=1,b=Is(1))), "not equal" 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 408s return self == other 408s ^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 408s self._changes.append(next(it)) 408s ^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 194, in assign 408s result_kwargs[key] = yield from self.get_adapter( 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 408s new_code = self.context.file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s _________________________________ test_reeval __________________________________ 408s 408s def test_reeval(): 408s Example( 408s """\ 408s from inline_snapshot import snapshot,Is 408s from dataclasses import dataclass 408s 408s @dataclass 408s class A: 408s a:int 408s b:int 408s 408s def test_something(): 408s for c in "ab": 408s assert A(a=1,b=c) == snapshot(A(a=2,b=Is(c))) 408s """ 408s > ).run_inline( 408s ["--inline-snapshot=fix"], 408s changed_files=snapshot( 408s { 408s "test_something.py": """\ 408s from inline_snapshot import snapshot,Is 408s from dataclasses import dataclass 408s 408s @dataclass 408s class A: 408s a:int 408s b:int 408s 408s def test_something(): 408s for c in "ab": 408s assert A(a=1,b=c) == snapshot(A(a=1,b=Is(c))) 408s """ 408s } 408s ), 408s ) 408s 408s tests/adapter/test_dataclass.py:63: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s self = 408s args = ['--inline-snapshot=fix'] 408s 408s def run_inline( 408s self, 408s args: list[str] = [], 408s *, 408s reported_categories: Snapshot[list[Category]] | None = None, 408s changed_files: Snapshot[dict[str, str]] | None = None, 408s report: Snapshot[str] | None = None, 408s raises: Snapshot[str] | None = None, 408s ) -> Example: 408s """Execute the example files in process and run every `test_*` 408s function. 408s 408s This is useful for fast test execution. 408s 408s Parameters: 408s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 408s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 408s changed_files: snapshot of files which are changed by this run. 408s raises: snapshot of the exception which is raised during the test execution. 408s It is required if your code raises an exception. 408s 408s Returns: 408s A new Example instance which contains the changed files. 408s """ 408s 408s parser = ArgumentParser() 408s 408s parser.add_argument( 408s "--inline-snapshot", 408s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 408s dest="inline_snapshot", 408s help="update specific snapshot values:\n" 408s "disable: disable the snapshot logic\n" 408s "short-report: show a short report\n" 408s "report: show a longer report with a diff report\n" 408s "review: allow to approve the changes interactive\n" 408s "create: creates snapshots which are currently not defined\n" 408s "update: update snapshots even if they are defined\n" 408s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 408s "fix: change snapshots which currently break your tests\n", 408s ) 408s parsed_args = parser.parse_args(args) 408s flags = (parsed_args.inline_snapshot or "").split(",") 408s 408s with TemporaryDirectory() as dir: 408s tmp_path = Path(dir) 408s 408s self._write_files(tmp_path) 408s 408s raised_exception = None 408s with snapshot_env(): 408s with ChangeRecorder().activate() as recorder: 408s _inline_snapshot._update_flags = Flags({*flags}) 408s inline_snapshot._external.storage = ( 408s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 408s ) 408s 408s try: 408s for filename in tmp_path.glob("*.py"): 408s globals: dict[str, Any] = {} 408s print("run> pytest", filename) 408s exec( 408s compile(filename.read_text("utf-8"), filename, "exec"), 408s globals, 408s ) 408s 408s # run all test_* functions 408s for k, v in globals.items(): 408s if k.startswith("test_") and callable(v): 408s v() 408s except Exception as e: 408s traceback.print_exc() 408s raised_exception = e 408s 408s finally: 408s _inline_snapshot._active = False 408s 408s changes = [] 408s for snapshot in _inline_snapshot.snapshots.values(): 408s changes += snapshot._changes() 408s 408s snapshot_flags = {change.flag for change in changes} 408s 408s apply_all( 408s [ 408s change 408s for change in changes 408s if change.flag in _inline_snapshot._update_flags.to_set() 408s ] 408s ) 408s recorder.fix_all() 408s 408s report_output = StringIO() 408s console = Console(file=report_output) 408s 408s # TODO: add all the report output here 408s report_problems(console) 408s 408s if reported_categories is not None: 408s assert sorted(snapshot_flags) == reported_categories 408s 408s if raised_exception is not None: 408s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 408s raised_exception 408s ) 408s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 408s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot,Is 408s from dataclasses import dataclass 408s 408s @dataclass 408s class A: 408s a:int 408s b:int 408s 408s def test_something(): 408s for c in "ab": 408s assert A(a=1,b=c) == snapshot(A(a=2,b=Is(c))) 408s 408s 408s run> pytest /tmp/tmp8faluovj/test_something.py 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 408s v() 408s File "/tmp/tmp8faluovj/test_something.py", line 11, in test_something 408s assert A(a=1,b=c) == snapshot(A(a=2,b=Is(c))) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 408s return self == other 408s ^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 408s self._changes.append(next(it)) 408s ^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 194, in assign 408s result_kwargs[key] = yield from self.get_adapter( 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 408s new_code = self.context.file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s _________________________ test_dataclass_default_value _________________________ 408s 408s def test_dataclass_default_value(): 408s Example( 408s """\ 408s from inline_snapshot import snapshot,Is 408s from dataclasses import dataclass,field 408s 408s @dataclass 408s class A: 408s a:int 408s b:int=2 408s c:list=field(default_factory=list) 408s 408s def test_something(): 408s assert A(a=1) == snapshot(A(a=1,b=2,c=[])) 408s """ 408s > ).run_inline( 408s ["--inline-snapshot=update"], 408s changed_files=snapshot( 408s { 408s "test_something.py": """\ 408s from inline_snapshot import snapshot,Is 408s from dataclasses import dataclass,field 408s 408s @dataclass 408s class A: 408s a:int 408s b:int=2 408s c:list=field(default_factory=list) 408s 408s def test_something(): 408s assert A(a=1) == snapshot(A(a=1)) 408s """ 408s } 408s ), 408s ) 408s 408s tests/adapter/test_dataclass.py:100: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:214: in run_inline 408s recorder.fix_all() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 408s file.rewrite() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 408s new_code = self.new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 408s format_whole_file = enforce_formatting() or code == format_code( 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s 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' 408s filename = PosixPath('/tmp/tmp4nlsbetu/test_something.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot,Is 408s from dataclasses import dataclass,field 408s 408s @dataclass 408s class A: 408s a:int 408s b:int=2 408s c:list=field(default_factory=list) 408s 408s def test_something(): 408s assert A(a=1) == snapshot(A(a=1,b=2,c=[])) 408s 408s 408s run> pytest /tmp/tmp4nlsbetu/test_something.py 408s ___________________________ test_attrs_default_value ___________________________ 408s 408s def test_attrs_default_value(): 408s Example( 408s """\ 408s from inline_snapshot import snapshot,Is 408s import attrs 408s 408s @attrs.define 408s class A: 408s a:int 408s b:int=2 408s c:list=attrs.field(factory=list) 408s d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) 408s 408s def test_something(): 408s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 408s assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) 408s """ 408s > ).run_pytest( 408s ["--inline-snapshot=fix"], 408s changed_files=snapshot( 408s { 408s "test_something.py": """\ 408s from inline_snapshot import snapshot,Is 408s import attrs 408s 408s @attrs.define 408s class A: 408s a:int 408s b:int=2 408s c:list=attrs.field(factory=list) 408s d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) 408s 408s def test_something(): 408s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 408s assert A(a=2,b=3) == snapshot(A(a=2,b=3,c=[],d=11)) 408s """ 408s } 408s ), 408s ).run_pytest( 408s ["--inline-snapshot=update"], 408s changed_files=snapshot( 408s { 408s "test_something.py": """\ 408s from inline_snapshot import snapshot,Is 408s import attrs 408s 408s @attrs.define 408s class A: 408s a:int 408s b:int=2 408s c:list=attrs.field(factory=list) 408s d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) 408s 408s def test_something(): 408s assert A(a=1) == snapshot(A(a=1)) 408s assert A(a=2,b=3) == snapshot(A(a=2,b=3)) 408s """ 408s } 408s ), 408s ) 408s 408s tests/adapter/test_dataclass.py:139: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s self = 408s args = ['--inline-snapshot=fix'] 408s 408s def run_pytest( 408s self, 408s args: list[str] = [], 408s *, 408s term_columns=80, 408s env: dict[str, str] = {}, 408s changed_files: Snapshot[dict[str, str]] | None = None, 408s report: Snapshot[str] | None = None, 408s stderr: Snapshot[str] | None = None, 408s returncode: Snapshot[int] | None = None, 408s ) -> Example: 408s """Run pytest with the given args and env variables in an seperate 408s process. 408s 408s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 408s 408s Parameters: 408s args: pytest arguments like "--inline-snapshot=fix" 408s env: dict of environment variables 408s changed_files: snapshot of files which are changed by this run. 408s report: snapshot of the report at the end of the pytest run. 408s stderr: pytest stderr output 408s returncode: snapshot of the pytest returncode. 408s 408s Returns: 408s A new Example instance which contains the changed files. 408s """ 408s 408s with TemporaryDirectory() as dir: 408s tmp_path = Path(dir) 408s self._write_files(tmp_path) 408s 408s cmd = [sys.executable, "-m", "pytest", *args] 408s 408s command_env = dict(os.environ) 408s command_env["TERM"] = "unknown" 408s command_env["COLUMNS"] = str( 408s term_columns + 1 if platform.system() == "Windows" else term_columns 408s ) 408s command_env.pop("CI", None) 408s 408s command_env.update(env) 408s 408s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 408s 408s print("run>", *cmd) 408s print("stdout:") 408s print(result.stdout.decode()) 408s print("stderr:") 408s print(result.stderr.decode()) 408s 408s if returncode is not None: 408s assert result.returncode == returncode 408s 408s if stderr is not None: 408s assert result.stderr.decode() == stderr 408s 408s if report is not None: 408s 408s report_list = [] 408s record = False 408s for line in result.stdout.decode().splitlines(): 408s line = line.strip() 408s if line.startswith("===="): 408s record = False 408s 408s if record and line: 408s report_list.append(line) 408s 408s if line.startswith("====") and "inline snapshot" in line: 408s record = True 408s 408s report_str = "\n".join(report_list) 408s 408s assert normalize(report_str) == report, repr(report_str) 408s 408s if changed_files is not None: 408s current_files = {} 408s 408s for name, content in sorted(self._read_files(tmp_path).items()): 408s if name not in self.files or self.files[name] != content: 408s current_files[name] = content 408s > assert changed_files == current_files 408s E AssertionError: assert {'test_someth...=[],d=11))\n'} == {} 408s E 408s E Left contains 1 more item: 408s E {'test_something.py': 'from inline_snapshot import snapshot,Is\n' 408s E 'import attrs\n' 408s E '\n' 408s E '@attrs.define\n' 408s E 'class A:\n'... 408s E 408s E ...Full output truncated (11 lines hidden), use '-vv' to show 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot,Is 408s import attrs 408s 408s @attrs.define 408s class A: 408s a:int 408s b:int=2 408s c:list=attrs.field(factory=list) 408s d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) 408s 408s def test_something(): 408s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 408s assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) 408s 408s 408s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 408s stdout: 408s ============================= test session starts ============================== 408s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/tmp2j48lme8 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_something.py F [100%] 408s 408s =================================== FAILURES =================================== 408s ________________________________ test_something ________________________________ 408s 408s def test_something(): 408s assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) 408s > assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) 408s 408s test_something.py:13: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:194: in assign 408s result_kwargs[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '2 ', filename = PosixPath('/tmp/tmp2j48lme8/test_something.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_something.py::test_something - TypeError: CliRunner.__init__() go... 408s ============================== 1 failed in 0.28s =============================== 408s 408s stderr: 408s 408s ____________________________ test_attrs_field_repr _____________________________ 408s 408s def test_attrs_field_repr(): 408s 408s Example( 408s """\ 408s from inline_snapshot import snapshot 408s import attrs 408s 408s @attrs.define 408s class container: 408s a: int 408s b: int = attrs.field(default=5,repr=False) 408s 408s assert container(a=1,b=5) == snapshot() 408s """ 408s > ).run_pytest( 408s ["--inline-snapshot=create"], 408s changed_files=snapshot( 408s { 408s "test_something.py": """\ 408s from inline_snapshot import snapshot 408s import attrs 408s 408s @attrs.define 408s class container: 408s a: int 408s b: int = attrs.field(default=5,repr=False) 408s 408s assert container(a=1,b=5) == snapshot(container(a=1)) 408s """ 408s } 408s ), 408s ).run_pytest() 408s 408s tests/adapter/test_dataclass.py:198: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s self = 408s args = ['--inline-snapshot=create'] 408s 408s def run_pytest( 408s self, 408s args: list[str] = [], 408s *, 408s term_columns=80, 408s env: dict[str, str] = {}, 408s changed_files: Snapshot[dict[str, str]] | None = None, 408s report: Snapshot[str] | None = None, 408s stderr: Snapshot[str] | None = None, 408s returncode: Snapshot[int] | None = None, 408s ) -> Example: 408s """Run pytest with the given args and env variables in an seperate 408s process. 408s 408s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 408s 408s Parameters: 408s args: pytest arguments like "--inline-snapshot=fix" 408s env: dict of environment variables 408s changed_files: snapshot of files which are changed by this run. 408s report: snapshot of the report at the end of the pytest run. 408s stderr: pytest stderr output 408s returncode: snapshot of the pytest returncode. 408s 408s Returns: 408s A new Example instance which contains the changed files. 408s """ 408s 408s with TemporaryDirectory() as dir: 408s tmp_path = Path(dir) 408s self._write_files(tmp_path) 408s 408s cmd = [sys.executable, "-m", "pytest", *args] 408s 408s command_env = dict(os.environ) 408s command_env["TERM"] = "unknown" 408s command_env["COLUMNS"] = str( 408s term_columns + 1 if platform.system() == "Windows" else term_columns 408s ) 408s command_env.pop("CI", None) 408s 408s command_env.update(env) 408s 408s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 408s 408s print("run>", *cmd) 408s print("stdout:") 408s print(result.stdout.decode()) 408s print("stderr:") 408s print(result.stderr.decode()) 408s 408s if returncode is not None: 408s assert result.returncode == returncode 408s 408s if stderr is not None: 408s assert result.stderr.decode() == stderr 408s 408s if report is not None: 408s 408s report_list = [] 408s record = False 408s for line in result.stdout.decode().splitlines(): 408s line = line.strip() 408s if line.startswith("===="): 408s record = False 408s 408s if record and line: 408s report_list.append(line) 408s 408s if line.startswith("====") and "inline snapshot" in line: 408s record = True 408s 408s report_str = "\n".join(report_list) 408s 408s assert normalize(report_str) == report, repr(report_str) 408s 408s if changed_files is not None: 408s current_files = {} 408s 408s for name, content in sorted(self._read_files(tmp_path).items()): 408s if name not in self.files or self.files[name] != content: 408s current_files[name] = content 408s > assert changed_files == current_files 408s E AssertionError: assert {'test_someth...iner(a=1))\n'} == {} 408s E 408s E Left contains 1 more item: 408s E {'test_something.py': 'from inline_snapshot import snapshot\n' 408s E 'import attrs\n' 408s E '\n' 408s E '@attrs.define\n' 408s E 'class container:\n'... 408s E 408s E ...Full output truncated (5 lines hidden), use '-vv' to show 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot 408s import attrs 408s 408s @attrs.define 408s class container: 408s a: int 408s b: int = attrs.field(default=5,repr=False) 408s 408s assert container(a=1,b=5) == snapshot() 408s 408s 408s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 408s stdout: 408s ============================= test session starts ============================== 408s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/tmpbubh3c8e 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 0 items / 1 error 408s 408s ==================================== ERRORS ==================================== 408s ______________________ ERROR collecting test_something.py ______________________ 408s test_something.py:9: in 408s assert container(a=1,b=5) == snapshot() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 408s runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s ERROR test_something.py - TypeError: CliRunner.__init__() got an unexpected k... 408s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 408s =============================== 1 error in 0.38s =============================== 408s 408s stderr: 408s 408s ___________________________ test_disabled[executing] ___________________________ 408s 408s executing_used = True 408s 408s def test_disabled(executing_used): 408s Example( 408s """\ 408s from inline_snapshot import snapshot 408s from dataclasses import dataclass 408s 408s @dataclass 408s class A: 408s a:int 408s 408s def test_something(): 408s assert A(a=3) == snapshot(A(a=5)),"not equal" 408s """ 408s > ).run_inline( 408s changed_files=snapshot({}), 408s raises=snapshot( 408s """\ 408s AssertionError: 408s not equal\ 408s """ 408s ), 408s ) 408s 408s tests/adapter/test_dataclass.py:261: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 408s assert raises == f"{type(raised_exception).__name__}:\n" + str( 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 408s filename = PosixPath('/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/adapter/test_dataclass.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot 408s from dataclasses import dataclass 408s 408s @dataclass 408s class A: 408s a:int 408s 408s def test_something(): 408s assert A(a=3) == snapshot(A(a=5)),"not equal" 408s 408s 408s run> pytest /tmp/tmp000s_5x5/test_something.py 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 408s v() 408s File "/tmp/tmp000s_5x5/test_something.py", line 9, in test_something 408s assert A(a=3) == snapshot(A(a=5)),"not equal" 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 408s return self == other 408s ^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 408s self._changes.append(next(it)) 408s ^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 194, in assign 408s result_kwargs[key] = yield from self.get_adapter( 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 408s new_code = self.context.file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s _______________________ test_disabled[without-executing] _______________________ 408s 408s executing_used = False 408s 408s def test_disabled(executing_used): 408s Example( 408s """\ 408s from inline_snapshot import snapshot 408s from dataclasses import dataclass 408s 408s @dataclass 408s class A: 408s a:int 408s 408s def test_something(): 408s assert A(a=3) == snapshot(A(a=5)),"not equal" 408s """ 408s > ).run_inline( 408s changed_files=snapshot({}), 408s raises=snapshot( 408s """\ 408s AssertionError: 408s not equal\ 408s """ 408s ), 408s ) 408s 408s tests/adapter/test_dataclass.py:261: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 408s assert raises == f"{type(raised_exception).__name__}:\n" + str( 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:53: in assign 408s and self.context.file._token_of_node(old_node) != new_token 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s self = 408s node = 408s 408s def _token_of_node(self, node): 408s 408s return list( 408s normalize( 408s [ 408s simple_token(t.type, t.string) 408s > for t in self._source.asttokens().get_tokens(node) 408s if t.type not in ignore_tokens 408s ] 408s ) 408s ) 408s E AttributeError: 'NoneType' object has no attribute 'asttokens' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:45: AttributeError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot 408s from dataclasses import dataclass 408s 408s @dataclass 408s class A: 408s a:int 408s 408s def test_something(): 408s assert A(a=3) == snapshot(A(a=5)),"not equal" 408s 408s 408s run> pytest /tmp/tmpjuhxluwe/test_something.py 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 408s v() 408s File "/tmp/tmpjuhxluwe/test_something.py", line 9, in test_something 408s assert A(a=3) == snapshot(A(a=5)),"not equal" 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError: not equal 408s ______________________________ test_add_argument _______________________________ 408s 408s def test_add_argument(): 408s Example( 408s """\ 408s from inline_snapshot import snapshot 408s from dataclasses import dataclass 408s 408s @dataclass 408s class A: 408s a:int=0 408s b:int=0 408s c:int=0 408s 408s def test_something(): 408s assert A(a=3,b=3,c=3) == snapshot(A(b=3)),"not equal" 408s """ 408s > ).run_inline( 408s ["--inline-snapshot=fix"], 408s changed_files=snapshot( 408s { 408s "test_something.py": """\ 408s from inline_snapshot import snapshot 408s from dataclasses import dataclass 408s 408s @dataclass 408s class A: 408s a:int=0 408s b:int=0 408s c:int=0 408s 408s def test_something(): 408s assert A(a=3,b=3,c=3) == snapshot(A(a = 3, b=3, c = 3)),"not equal" 408s """ 408s } 408s ), 408s raises=snapshot(None), 408s ) 408s 408s tests/adapter/test_dataclass.py:322: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 408s assert raises == f"{type(raised_exception).__name__}:\n" + str( 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 408s filename = PosixPath('/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/adapter/test_dataclass.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot 408s from dataclasses import dataclass 408s 408s @dataclass 408s class A: 408s a:int=0 408s b:int=0 408s c:int=0 408s 408s def test_something(): 408s assert A(a=3,b=3,c=3) == snapshot(A(b=3)),"not equal" 408s 408s 408s run> pytest /tmp/tmpxf5bgzw1/test_something.py 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 408s v() 408s File "/tmp/tmpxf5bgzw1/test_something.py", line 11, in test_something 408s assert A(a=3,b=3,c=3) == snapshot(A(b=3)),"not equal" 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 408s return self == other 408s ^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 408s self._changes.append(next(it)) 408s ^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 207, in assign 408s new_code=self.context.file._value_to_code(value), 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 37, in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s _______________________ test_remove_positional_argument ________________________ 408s 408s def test_remove_positional_argument(): 408s Example( 408s """\ 408s from inline_snapshot import snapshot 408s 408s from inline_snapshot._adapter.generic_call_adapter import GenericCallAdapter,Argument 408s 408s 408s class L: 408s def __init__(self,*l): 408s self.l=l 408s 408s def __eq__(self,other): 408s if not isinstance(other,L): 408s return NotImplemented 408s return other.l==self.l 408s 408s class LAdapter(GenericCallAdapter): 408s @classmethod 408s def check_type(cls, typ): 408s return issubclass(typ,L) 408s 408s @classmethod 408s def arguments(cls, value): 408s return ([Argument(x) for x in value.l],{}) 408s 408s @classmethod 408s def argument(cls, value, pos_or_name): 408s assert isinstance(pos_or_name,int) 408s return value.l[pos_or_name] 408s 408s def test_L1(): 408s assert L(1,2) == snapshot(L(1)), "not equal" 408s 408s def test_L2(): 408s assert L(1,2) == snapshot(L(1, 2, 3)), "not equal" 408s """ 408s > ).run_pytest( 408s ["--inline-snapshot=fix"], 408s changed_files=snapshot( 408s { 408s "test_something.py": """\ 408s from inline_snapshot import snapshot 408s 408s from inline_snapshot._adapter.generic_call_adapter import GenericCallAdapter,Argument 408s 408s 408s class L: 408s def __init__(self,*l): 408s self.l=l 408s 408s def __eq__(self,other): 408s if not isinstance(other,L): 408s return NotImplemented 408s return other.l==self.l 408s 408s class LAdapter(GenericCallAdapter): 408s @classmethod 408s def check_type(cls, typ): 408s return issubclass(typ,L) 408s 408s @classmethod 408s def arguments(cls, value): 408s return ([Argument(x) for x in value.l],{}) 408s 408s @classmethod 408s def argument(cls, value, pos_or_name): 408s assert isinstance(pos_or_name,int) 408s return value.l[pos_or_name] 408s 408s def test_L1(): 408s assert L(1,2) == snapshot(L(1, 2)), "not equal" 408s 408s def test_L2(): 408s assert L(1,2) == snapshot(L(1, 2)), "not equal" 408s """ 408s } 408s ), 408s ) 408s 408s tests/adapter/test_dataclass.py:408: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s self = 408s args = ['--inline-snapshot=fix'] 408s 408s def run_pytest( 408s self, 408s args: list[str] = [], 408s *, 408s term_columns=80, 408s env: dict[str, str] = {}, 408s changed_files: Snapshot[dict[str, str]] | None = None, 408s report: Snapshot[str] | None = None, 408s stderr: Snapshot[str] | None = None, 408s returncode: Snapshot[int] | None = None, 408s ) -> Example: 408s """Run pytest with the given args and env variables in an seperate 408s process. 408s 408s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 408s 408s Parameters: 408s args: pytest arguments like "--inline-snapshot=fix" 408s env: dict of environment variables 408s changed_files: snapshot of files which are changed by this run. 408s report: snapshot of the report at the end of the pytest run. 408s stderr: pytest stderr output 408s returncode: snapshot of the pytest returncode. 408s 408s Returns: 408s A new Example instance which contains the changed files. 408s """ 408s 408s with TemporaryDirectory() as dir: 408s tmp_path = Path(dir) 408s self._write_files(tmp_path) 408s 408s cmd = [sys.executable, "-m", "pytest", *args] 408s 408s command_env = dict(os.environ) 408s command_env["TERM"] = "unknown" 408s command_env["COLUMNS"] = str( 408s term_columns + 1 if platform.system() == "Windows" else term_columns 408s ) 408s command_env.pop("CI", None) 408s 408s command_env.update(env) 408s 408s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 408s 408s print("run>", *cmd) 408s print("stdout:") 408s print(result.stdout.decode()) 408s print("stderr:") 408s print(result.stderr.decode()) 408s 408s if returncode is not None: 408s assert result.returncode == returncode 408s 408s if stderr is not None: 408s assert result.stderr.decode() == stderr 408s 408s if report is not None: 408s 408s report_list = [] 408s record = False 408s for line in result.stdout.decode().splitlines(): 408s line = line.strip() 408s if line.startswith("===="): 408s record = False 408s 408s if record and line: 408s report_list.append(line) 408s 408s if line.startswith("====") and "inline snapshot" in line: 408s record = True 408s 408s report_str = "\n".join(report_list) 408s 408s assert normalize(report_str) == report, repr(report_str) 408s 408s if changed_files is not None: 408s current_files = {} 408s 408s for name, content in sorted(self._read_files(tmp_path).items()): 408s if name not in self.files or self.files[name] != content: 408s current_files[name] = content 408s > assert changed_files == current_files 408s E assert {'test_someth...not equal"\n'} == {} 408s E 408s E Left contains 1 more item: 408s E {'test_something.py': 'from inline_snapshot import snapshot\n' 408s E '\n' 408s E 'from inline_snapshot._adapter.generic_call_adapter ' 408s E 'import GenericCallAdapter,Argument\n' 408s E '\n'... 408s E 408s E ...Full output truncated (30 lines hidden), use '-vv' to show 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot 408s 408s from inline_snapshot._adapter.generic_call_adapter import GenericCallAdapter,Argument 408s 408s 408s class L: 408s def __init__(self,*l): 408s self.l=l 408s 408s def __eq__(self,other): 408s if not isinstance(other,L): 408s return NotImplemented 408s return other.l==self.l 408s 408s class LAdapter(GenericCallAdapter): 408s @classmethod 408s def check_type(cls, typ): 408s return issubclass(typ,L) 408s 408s @classmethod 408s def arguments(cls, value): 408s return ([Argument(x) for x in value.l],{}) 408s 408s @classmethod 408s def argument(cls, value, pos_or_name): 408s assert isinstance(pos_or_name,int) 408s return value.l[pos_or_name] 408s 408s def test_L1(): 408s assert L(1,2) == snapshot(L(1)), "not equal" 408s 408s def test_L2(): 408s assert L(1,2) == snapshot(L(1, 2, 3)), "not equal" 408s 408s 408s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 408s stdout: 408s ============================= test session starts ============================== 408s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/tmpfdrv_ghf 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 2 items 408s 408s test_something.py F. [100%] 408s 408s =================================== FAILURES =================================== 408s ___________________________________ test_L1 ____________________________________ 408s 408s def test_L1(): 408s > assert L(1,2) == snapshot(L(1)), "not equal" 408s 408s test_something.py:30: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:162: in assign 408s new_code=self.context.file._value_to_code(value.value), 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '2 ', filename = PosixPath('/tmp/tmpfdrv_ghf/test_something.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s ──────────────────────────────── Fix snapshots ───────────────────────────────── 408s =========================== short test summary info ============================ 408s FAILED test_something.py::test_L1 - TypeError: CliRunner.__init__() got an un... 408s 408s stderr: 408s Traceback (most recent call last): 408s File "", line 198, in _run_module_as_main 408s File "", line 88, in _run_code 408s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 408s raise SystemExit(pytest.console_main()) 408s ^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 408s code = main() 408s ^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 408s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 408s res = hook_impl.function(*args) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 408s return wrap_session(config, _main) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 408s config.hook.pytest_sessionfinish( 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 408s teardown.send(result) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 408s self.config.hook.pytest_terminal_summary( 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 408s res = hook_impl.function(*args) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary 408s diff = file.diff() 408s ^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff 408s unified_diff(self.source.splitlines(), self.new_code().splitlines()), 408s ^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code 408s format_whole_file = enforce_formatting() or code == format_code( 408s ^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s _______________________________ test_namedtuple ________________________________ 408s 408s def test_namedtuple(): 408s Example( 408s """\ 408s from inline_snapshot import snapshot 408s from collections import namedtuple 408s 408s T=namedtuple("T","a,b") 408s 408s def test_tuple(): 408s assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" 408s """ 408s > ).run_pytest( 408s ["--inline-snapshot=fix"], 408s changed_files=snapshot( 408s { 408s "test_something.py": """\ 408s from inline_snapshot import snapshot 408s from collections import namedtuple 408s 408s T=namedtuple("T","a,b") 408s 408s def test_tuple(): 408s assert T(a=1,b=2) == snapshot(T(a=1, b=2)), "not equal" 408s """ 408s } 408s ), 408s ) 408s 408s tests/adapter/test_dataclass.py:463: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s self = 408s args = ['--inline-snapshot=fix'] 408s 408s def run_pytest( 408s self, 408s args: list[str] = [], 408s *, 408s term_columns=80, 408s env: dict[str, str] = {}, 408s changed_files: Snapshot[dict[str, str]] | None = None, 408s report: Snapshot[str] | None = None, 408s stderr: Snapshot[str] | None = None, 408s returncode: Snapshot[int] | None = None, 408s ) -> Example: 408s """Run pytest with the given args and env variables in an seperate 408s process. 408s 408s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 408s 408s Parameters: 408s args: pytest arguments like "--inline-snapshot=fix" 408s env: dict of environment variables 408s changed_files: snapshot of files which are changed by this run. 408s report: snapshot of the report at the end of the pytest run. 408s stderr: pytest stderr output 408s returncode: snapshot of the pytest returncode. 408s 408s Returns: 408s A new Example instance which contains the changed files. 408s """ 408s 408s with TemporaryDirectory() as dir: 408s tmp_path = Path(dir) 408s self._write_files(tmp_path) 408s 408s cmd = [sys.executable, "-m", "pytest", *args] 408s 408s command_env = dict(os.environ) 408s command_env["TERM"] = "unknown" 408s command_env["COLUMNS"] = str( 408s term_columns + 1 if platform.system() == "Windows" else term_columns 408s ) 408s command_env.pop("CI", None) 408s 408s command_env.update(env) 408s 408s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 408s 408s print("run>", *cmd) 408s print("stdout:") 408s print(result.stdout.decode()) 408s print("stderr:") 408s print(result.stderr.decode()) 408s 408s if returncode is not None: 408s assert result.returncode == returncode 408s 408s if stderr is not None: 408s assert result.stderr.decode() == stderr 408s 408s if report is not None: 408s 408s report_list = [] 408s record = False 408s for line in result.stdout.decode().splitlines(): 408s line = line.strip() 408s if line.startswith("===="): 408s record = False 408s 408s if record and line: 408s report_list.append(line) 408s 408s if line.startswith("====") and "inline snapshot" in line: 408s record = True 408s 408s report_str = "\n".join(report_list) 408s 408s assert normalize(report_str) == report, repr(report_str) 408s 408s if changed_files is not None: 408s current_files = {} 408s 408s for name, content in sorted(self._read_files(tmp_path).items()): 408s if name not in self.files or self.files[name] != content: 408s current_files[name] = content 408s > assert changed_files == current_files 408s E assert {'test_someth...not equal"\n'} == {} 408s E 408s E Left contains 1 more item: 408s E {'test_something.py': 'from inline_snapshot import snapshot\n' 408s E 'from collections import namedtuple\n' 408s E '\n' 408s E 'T=namedtuple("T","a,b")\n' 408s E '\n'... 408s E 408s E ...Full output truncated (4 lines hidden), use '-vv' to show 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot 408s from collections import namedtuple 408s 408s T=namedtuple("T","a,b") 408s 408s def test_tuple(): 408s assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" 408s 408s 408s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 408s stdout: 408s ============================= test session starts ============================== 408s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/tmpnn6lf1wr 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_something.py F [100%] 408s 408s =================================== FAILURES =================================== 408s __________________________________ test_tuple __________________________________ 408s 408s def test_tuple(): 408s > assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" 408s 408s test_something.py:7: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:194: in assign 408s result_kwargs[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '2 ', filename = PosixPath('/tmp/tmpnn6lf1wr/test_something.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_something.py::test_tuple - TypeError: CliRunner.__init__() got an... 408s ============================== 1 failed in 0.27s =============================== 408s 408s stderr: 408s 408s _______________________________ test_defaultdict _______________________________ 408s 408s def test_defaultdict(): 408s Example( 408s """\ 408s from inline_snapshot import snapshot 408s from collections import defaultdict 408s 408s 408s def test_tuple(): 408s d=defaultdict(list) 408s d[1].append(2) 408s assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" 408s """ 408s > ).run_pytest( 408s ["--inline-snapshot=fix"], 408s changed_files=snapshot( 408s { 408s "test_something.py": """\ 408s from inline_snapshot import snapshot 408s from collections import defaultdict 408s 408s 408s def test_tuple(): 408s d=defaultdict(list) 408s d[1].append(2) 408s assert d == snapshot(defaultdict(list, {1: [2]})), "not equal" 408s """ 408s } 408s ), 408s ) 408s 408s tests/adapter/test_dataclass.py:493: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s self = 408s args = ['--inline-snapshot=fix'] 408s 408s def run_pytest( 408s self, 408s args: list[str] = [], 408s *, 408s term_columns=80, 408s env: dict[str, str] = {}, 408s changed_files: Snapshot[dict[str, str]] | None = None, 408s report: Snapshot[str] | None = None, 408s stderr: Snapshot[str] | None = None, 408s returncode: Snapshot[int] | None = None, 408s ) -> Example: 408s """Run pytest with the given args and env variables in an seperate 408s process. 408s 408s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 408s 408s Parameters: 408s args: pytest arguments like "--inline-snapshot=fix" 408s env: dict of environment variables 408s changed_files: snapshot of files which are changed by this run. 408s report: snapshot of the report at the end of the pytest run. 408s stderr: pytest stderr output 408s returncode: snapshot of the pytest returncode. 408s 408s Returns: 408s A new Example instance which contains the changed files. 408s """ 408s 408s with TemporaryDirectory() as dir: 408s tmp_path = Path(dir) 408s self._write_files(tmp_path) 408s 408s cmd = [sys.executable, "-m", "pytest", *args] 408s 408s command_env = dict(os.environ) 408s command_env["TERM"] = "unknown" 408s command_env["COLUMNS"] = str( 408s term_columns + 1 if platform.system() == "Windows" else term_columns 408s ) 408s command_env.pop("CI", None) 408s 408s command_env.update(env) 408s 408s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 408s 408s print("run>", *cmd) 408s print("stdout:") 408s print(result.stdout.decode()) 408s print("stderr:") 408s print(result.stderr.decode()) 408s 408s if returncode is not None: 408s assert result.returncode == returncode 408s 408s if stderr is not None: 408s assert result.stderr.decode() == stderr 408s 408s if report is not None: 408s 408s report_list = [] 408s record = False 408s for line in result.stdout.decode().splitlines(): 408s line = line.strip() 408s if line.startswith("===="): 408s record = False 408s 408s if record and line: 408s report_list.append(line) 408s 408s if line.startswith("====") and "inline snapshot" in line: 408s record = True 408s 408s report_str = "\n".join(report_list) 408s 408s assert normalize(report_str) == report, repr(report_str) 408s 408s if changed_files is not None: 408s current_files = {} 408s 408s for name, content in sorted(self._read_files(tmp_path).items()): 408s if name not in self.files or self.files[name] != content: 408s current_files[name] = content 408s > assert changed_files == current_files 408s E assert {'test_someth...not equal"\n'} == {} 408s E 408s E Left contains 1 more item: 408s E {'test_something.py': 'from inline_snapshot import snapshot\n' 408s E 'from collections import defaultdict\n' 408s E '\n' 408s E '\n' 408s E 'def test_tuple():\n'... 408s E 408s E ...Full output truncated (5 lines hidden), use '-vv' to show 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot 408s from collections import defaultdict 408s 408s 408s def test_tuple(): 408s d=defaultdict(list) 408s d[1].append(2) 408s assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" 408s 408s 408s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 408s stdout: 408s ============================= test session starts ============================== 408s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/tmpxhw0f9ea 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_something.py F [100%] 408s 408s =================================== FAILURES =================================== 408s __________________________________ test_tuple __________________________________ 408s 408s def test_tuple(): 408s d=defaultdict(list) 408s d[1].append(2) 408s > assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" 408s 408s test_something.py:8: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:140: in assign 408s result = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '2 ', filename = PosixPath('/tmp/tmpxhw0f9ea/test_something.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_something.py::test_tuple - TypeError: CliRunner.__init__() got an... 408s ============================== 1 failed in 0.30s =============================== 408s 408s stderr: 408s 408s __________________________ test_dataclass_field_repr ___________________________ 408s 408s def test_dataclass_field_repr(): 408s 408s Example( 408s """\ 408s from inline_snapshot import snapshot 408s from dataclasses import dataclass,field 408s 408s @dataclass 408s class container: 408s a: int 408s b: int = field(default=5,repr=False) 408s 408s assert container(a=1,b=5) == snapshot() 408s """ 408s > ).run_inline( 408s ["--inline-snapshot=create"], 408s changed_files=snapshot( 408s { 408s "test_something.py": """\ 408s from inline_snapshot import snapshot 408s from dataclasses import dataclass,field 408s 408s @dataclass 408s class container: 408s a: int 408s b: int = field(default=5,repr=False) 408s 408s assert container(a=1,b=5) == snapshot(container(a=1)) 408s """ 408s } 408s ), 408s ).run_inline() 408s 408s tests/adapter/test_dataclass.py:526: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s self = 408s args = ['--inline-snapshot=create'] 408s 408s def run_inline( 408s self, 408s args: list[str] = [], 408s *, 408s reported_categories: Snapshot[list[Category]] | None = None, 408s changed_files: Snapshot[dict[str, str]] | None = None, 408s report: Snapshot[str] | None = None, 408s raises: Snapshot[str] | None = None, 408s ) -> Example: 408s """Execute the example files in process and run every `test_*` 408s function. 408s 408s This is useful for fast test execution. 408s 408s Parameters: 408s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 408s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 408s changed_files: snapshot of files which are changed by this run. 408s raises: snapshot of the exception which is raised during the test execution. 408s It is required if your code raises an exception. 408s 408s Returns: 408s A new Example instance which contains the changed files. 408s """ 408s 408s parser = ArgumentParser() 408s 408s parser.add_argument( 408s "--inline-snapshot", 408s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 408s dest="inline_snapshot", 408s help="update specific snapshot values:\n" 408s "disable: disable the snapshot logic\n" 408s "short-report: show a short report\n" 408s "report: show a longer report with a diff report\n" 408s "review: allow to approve the changes interactive\n" 408s "create: creates snapshots which are currently not defined\n" 408s "update: update snapshots even if they are defined\n" 408s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 408s "fix: change snapshots which currently break your tests\n", 408s ) 408s parsed_args = parser.parse_args(args) 408s flags = (parsed_args.inline_snapshot or "").split(",") 408s 408s with TemporaryDirectory() as dir: 408s tmp_path = Path(dir) 408s 408s self._write_files(tmp_path) 408s 408s raised_exception = None 408s with snapshot_env(): 408s with ChangeRecorder().activate() as recorder: 408s _inline_snapshot._update_flags = Flags({*flags}) 408s inline_snapshot._external.storage = ( 408s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 408s ) 408s 408s try: 408s for filename in tmp_path.glob("*.py"): 408s globals: dict[str, Any] = {} 408s print("run> pytest", filename) 408s exec( 408s compile(filename.read_text("utf-8"), filename, "exec"), 408s globals, 408s ) 408s 408s # run all test_* functions 408s for k, v in globals.items(): 408s if k.startswith("test_") and callable(v): 408s v() 408s except Exception as e: 408s traceback.print_exc() 408s raised_exception = e 408s 408s finally: 408s _inline_snapshot._active = False 408s 408s changes = [] 408s for snapshot in _inline_snapshot.snapshots.values(): 408s changes += snapshot._changes() 408s 408s snapshot_flags = {change.flag for change in changes} 408s 408s apply_all( 408s [ 408s change 408s for change in changes 408s if change.flag in _inline_snapshot._update_flags.to_set() 408s ] 408s ) 408s recorder.fix_all() 408s 408s report_output = StringIO() 408s console = Console(file=report_output) 408s 408s # TODO: add all the report output here 408s report_problems(console) 408s 408s if reported_categories is not None: 408s assert sorted(snapshot_flags) == reported_categories 408s 408s if raised_exception is not None: 408s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 408s raised_exception 408s ) 408s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 408s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot 408s from dataclasses import dataclass,field 408s 408s @dataclass 408s class container: 408s a: int 408s b: int = field(default=5,repr=False) 408s 408s assert container(a=1,b=5) == snapshot() 408s 408s 408s run> pytest /tmp/tmpe4xcn60c/test_something.py 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 185, in run_inline 408s exec( 408s File "/tmp/tmpe4xcn60c/test_something.py", line 9, in 408s assert container(a=1,b=5) == snapshot() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 408s return self == other 408s ^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 408s self._changes.append(next(it)) 408s ^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 408s new_code = self.context.file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s ______________________________ test_dataclass_var ______________________________ 408s 408s def test_dataclass_var(): 408s 408s Example( 408s """\ 408s from inline_snapshot import snapshot,Is 408s from dataclasses import dataclass,field 408s 408s @dataclass 408s class container: 408s a: int 408s 408s def test_list(): 408s l=container(5) 408s assert l == snapshot(l), "not equal" 408s """ 408s > ).run_inline( 408s ["--inline-snapshot=update"], 408s changed_files=snapshot( 408s { 408s "test_something.py": """\ 408s from inline_snapshot import snapshot,Is 408s from dataclasses import dataclass,field 408s 408s @dataclass 408s class container: 408s a: int 408s 408s def test_list(): 408s l=container(5) 408s assert l == snapshot(container(a=5)), "not equal" 408s """ 408s } 408s ), 408s ) 408s 408s tests/adapter/test_dataclass.py:561: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s self = 408s args = ['--inline-snapshot=update'] 408s 408s def run_inline( 408s self, 408s args: list[str] = [], 408s *, 408s reported_categories: Snapshot[list[Category]] | None = None, 408s changed_files: Snapshot[dict[str, str]] | None = None, 408s report: Snapshot[str] | None = None, 408s raises: Snapshot[str] | None = None, 408s ) -> Example: 408s """Execute the example files in process and run every `test_*` 408s function. 408s 408s This is useful for fast test execution. 408s 408s Parameters: 408s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 408s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 408s changed_files: snapshot of files which are changed by this run. 408s raises: snapshot of the exception which is raised during the test execution. 408s It is required if your code raises an exception. 408s 408s Returns: 408s A new Example instance which contains the changed files. 408s """ 408s 408s parser = ArgumentParser() 408s 408s parser.add_argument( 408s "--inline-snapshot", 408s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 408s dest="inline_snapshot", 408s help="update specific snapshot values:\n" 408s "disable: disable the snapshot logic\n" 408s "short-report: show a short report\n" 408s "report: show a longer report with a diff report\n" 408s "review: allow to approve the changes interactive\n" 408s "create: creates snapshots which are currently not defined\n" 408s "update: update snapshots even if they are defined\n" 408s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 408s "fix: change snapshots which currently break your tests\n", 408s ) 408s parsed_args = parser.parse_args(args) 408s flags = (parsed_args.inline_snapshot or "").split(",") 408s 408s with TemporaryDirectory() as dir: 408s tmp_path = Path(dir) 408s 408s self._write_files(tmp_path) 408s 408s raised_exception = None 408s with snapshot_env(): 408s with ChangeRecorder().activate() as recorder: 408s _inline_snapshot._update_flags = Flags({*flags}) 408s inline_snapshot._external.storage = ( 408s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 408s ) 408s 408s try: 408s for filename in tmp_path.glob("*.py"): 408s globals: dict[str, Any] = {} 408s print("run> pytest", filename) 408s exec( 408s compile(filename.read_text("utf-8"), filename, "exec"), 408s globals, 408s ) 408s 408s # run all test_* functions 408s for k, v in globals.items(): 408s if k.startswith("test_") and callable(v): 408s v() 408s except Exception as e: 408s traceback.print_exc() 408s raised_exception = e 408s 408s finally: 408s _inline_snapshot._active = False 408s 408s changes = [] 408s for snapshot in _inline_snapshot.snapshots.values(): 408s changes += snapshot._changes() 408s 408s snapshot_flags = {change.flag for change in changes} 408s 408s apply_all( 408s [ 408s change 408s for change in changes 408s if change.flag in _inline_snapshot._update_flags.to_set() 408s ] 408s ) 408s recorder.fix_all() 408s 408s report_output = StringIO() 408s console = Console(file=report_output) 408s 408s # TODO: add all the report output here 408s report_problems(console) 408s 408s if reported_categories is not None: 408s assert sorted(snapshot_flags) == reported_categories 408s 408s if raised_exception is not None: 408s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 408s raised_exception 408s ) 408s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 408s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot,Is 408s from dataclasses import dataclass,field 408s 408s @dataclass 408s class container: 408s a: int 408s 408s def test_list(): 408s l=container(5) 408s assert l == snapshot(l), "not equal" 408s 408s 408s run> pytest /tmp/tmp5z0quzwt/test_something.py 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 408s v() 408s File "/tmp/tmp5z0quzwt/test_something.py", line 10, in test_list 408s assert l == snapshot(l), "not equal" 408s ^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 408s return self == other 408s ^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 408s self._changes.append(next(it)) 408s ^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 101, in assign 408s result = yield from self.value_assign(old_value, old_node, new_value) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py", line 87, in value_assign 408s result = yield from adapter.assign(old_value, old_node, new_value) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 408s new_code = self.context.file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s ________________________________ test_dict_var _________________________________ 408s 408s def test_dict_var(): 408s 408s Example( 408s """\ 408s from inline_snapshot import snapshot,Is 408s 408s def test_list(): 408s l={1:2} 408s assert l == snapshot(l), "not equal" 408s """ 408s > ).run_inline( 408s ["--inline-snapshot=update"], 408s changed_files=snapshot( 408s { 408s "test_something.py": """\ 408s from inline_snapshot import snapshot,Is 408s 408s def test_list(): 408s l={1:2} 408s assert l == snapshot({1: 2}), "not equal" 408s """ 408s } 408s ), 408s ) 408s 408s tests/adapter/test_dict.py:15: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s self = 408s args = ['--inline-snapshot=update'] 408s 408s def run_inline( 408s self, 408s args: list[str] = [], 408s *, 408s reported_categories: Snapshot[list[Category]] | None = None, 408s changed_files: Snapshot[dict[str, str]] | None = None, 408s report: Snapshot[str] | None = None, 408s raises: Snapshot[str] | None = None, 408s ) -> Example: 408s """Execute the example files in process and run every `test_*` 408s function. 408s 408s This is useful for fast test execution. 408s 408s Parameters: 408s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 408s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 408s changed_files: snapshot of files which are changed by this run. 408s raises: snapshot of the exception which is raised during the test execution. 408s It is required if your code raises an exception. 408s 408s Returns: 408s A new Example instance which contains the changed files. 408s """ 408s 408s parser = ArgumentParser() 408s 408s parser.add_argument( 408s "--inline-snapshot", 408s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 408s dest="inline_snapshot", 408s help="update specific snapshot values:\n" 408s "disable: disable the snapshot logic\n" 408s "short-report: show a short report\n" 408s "report: show a longer report with a diff report\n" 408s "review: allow to approve the changes interactive\n" 408s "create: creates snapshots which are currently not defined\n" 408s "update: update snapshots even if they are defined\n" 408s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 408s "fix: change snapshots which currently break your tests\n", 408s ) 408s parsed_args = parser.parse_args(args) 408s flags = (parsed_args.inline_snapshot or "").split(",") 408s 408s with TemporaryDirectory() as dir: 408s tmp_path = Path(dir) 408s 408s self._write_files(tmp_path) 408s 408s raised_exception = None 408s with snapshot_env(): 408s with ChangeRecorder().activate() as recorder: 408s _inline_snapshot._update_flags = Flags({*flags}) 408s inline_snapshot._external.storage = ( 408s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 408s ) 408s 408s try: 408s for filename in tmp_path.glob("*.py"): 408s globals: dict[str, Any] = {} 408s print("run> pytest", filename) 408s exec( 408s compile(filename.read_text("utf-8"), filename, "exec"), 408s globals, 408s ) 408s 408s # run all test_* functions 408s for k, v in globals.items(): 408s if k.startswith("test_") and callable(v): 408s v() 408s except Exception as e: 408s traceback.print_exc() 408s raised_exception = e 408s 408s finally: 408s _inline_snapshot._active = False 408s 408s changes = [] 408s for snapshot in _inline_snapshot.snapshots.values(): 408s changes += snapshot._changes() 408s 408s snapshot_flags = {change.flag for change in changes} 408s 408s apply_all( 408s [ 408s change 408s for change in changes 408s if change.flag in _inline_snapshot._update_flags.to_set() 408s ] 408s ) 408s recorder.fix_all() 408s 408s report_output = StringIO() 408s console = Console(file=report_output) 408s 408s # TODO: add all the report output here 408s report_problems(console) 408s 408s if reported_categories is not None: 408s assert sorted(snapshot_flags) == reported_categories 408s 408s if raised_exception is not None: 408s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 408s raised_exception 408s ) 408s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 408s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot,Is 408s 408s def test_list(): 408s l={1:2} 408s assert l == snapshot(l), "not equal" 408s 408s 408s run> pytest /tmp/tmpdm7jdp0k/test_something.py 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 408s v() 408s File "/tmp/tmpdm7jdp0k/test_something.py", line 5, in test_list 408s assert l == snapshot(l), "not equal" 408s ^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 408s return self == other 408s ^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 408s self._changes.append(next(it)) 408s ^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py", line 62, in assign 408s result = yield from self.value_assign(old_value, old_node, new_value) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py", line 87, in value_assign 408s result = yield from adapter.assign(old_value, old_node, new_value) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 408s new_code = self.context.file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s ____________________________ test_adapter_mismatch _____________________________ 408s 408s def test_adapter_mismatch(): 408s 408s Example( 408s """\ 408s from inline_snapshot import snapshot 408s 408s 408s def test_thing(): 408s assert [1,2] == snapshot({1:2}) 408s 408s """ 408s > ).run_inline( 408s ["--inline-snapshot=fix"], 408s changed_files=snapshot( 408s { 408s "test_something.py": """\ 408s from inline_snapshot import snapshot 408s 408s 408s def test_thing(): 408s assert [1,2] == snapshot([1, 2]) 408s 408s \ 408s """ 408s } 408s ), 408s ) 408s 408s tests/adapter/test_general.py:16: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s self = 408s args = ['--inline-snapshot=fix'] 408s 408s def run_inline( 408s self, 408s args: list[str] = [], 408s *, 408s reported_categories: Snapshot[list[Category]] | None = None, 408s changed_files: Snapshot[dict[str, str]] | None = None, 408s report: Snapshot[str] | None = None, 408s raises: Snapshot[str] | None = None, 408s ) -> Example: 408s """Execute the example files in process and run every `test_*` 408s function. 408s 408s This is useful for fast test execution. 408s 408s Parameters: 408s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 408s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 408s changed_files: snapshot of files which are changed by this run. 408s raises: snapshot of the exception which is raised during the test execution. 408s It is required if your code raises an exception. 408s 408s Returns: 408s A new Example instance which contains the changed files. 408s """ 408s 408s parser = ArgumentParser() 408s 408s parser.add_argument( 408s "--inline-snapshot", 408s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 408s dest="inline_snapshot", 408s help="update specific snapshot values:\n" 408s "disable: disable the snapshot logic\n" 408s "short-report: show a short report\n" 408s "report: show a longer report with a diff report\n" 408s "review: allow to approve the changes interactive\n" 408s "create: creates snapshots which are currently not defined\n" 408s "update: update snapshots even if they are defined\n" 408s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 408s "fix: change snapshots which currently break your tests\n", 408s ) 408s parsed_args = parser.parse_args(args) 408s flags = (parsed_args.inline_snapshot or "").split(",") 408s 408s with TemporaryDirectory() as dir: 408s tmp_path = Path(dir) 408s 408s self._write_files(tmp_path) 408s 408s raised_exception = None 408s with snapshot_env(): 408s with ChangeRecorder().activate() as recorder: 408s _inline_snapshot._update_flags = Flags({*flags}) 408s inline_snapshot._external.storage = ( 408s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 408s ) 408s 408s try: 408s for filename in tmp_path.glob("*.py"): 408s globals: dict[str, Any] = {} 408s print("run> pytest", filename) 408s exec( 408s compile(filename.read_text("utf-8"), filename, "exec"), 408s globals, 408s ) 408s 408s # run all test_* functions 408s for k, v in globals.items(): 408s if k.startswith("test_") and callable(v): 408s v() 408s except Exception as e: 408s traceback.print_exc() 408s raised_exception = e 408s 408s finally: 408s _inline_snapshot._active = False 408s 408s changes = [] 408s for snapshot in _inline_snapshot.snapshots.values(): 408s changes += snapshot._changes() 408s 408s snapshot_flags = {change.flag for change in changes} 408s 408s apply_all( 408s [ 408s change 408s for change in changes 408s if change.flag in _inline_snapshot._update_flags.to_set() 408s ] 408s ) 408s recorder.fix_all() 408s 408s report_output = StringIO() 408s console = Console(file=report_output) 408s 408s # TODO: add all the report output here 408s report_problems(console) 408s 408s if reported_categories is not None: 408s assert sorted(snapshot_flags) == reported_categories 408s 408s if raised_exception is not None: 408s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 408s raised_exception 408s ) 408s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 408s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot 408s 408s 408s def test_thing(): 408s assert [1,2] == snapshot({1:2}) 408s 408s 408s 408s run> pytest /tmp/tmpzi_ojc41/test_something.py 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 408s v() 408s File "/tmp/tmpzi_ojc41/test_something.py", line 5, in test_thing 408s assert [1,2] == snapshot({1:2}) 408s ^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 408s return self == other 408s ^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 408s self._changes.append(next(it)) 408s ^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 408s new_code = self.context.file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s ___________________ test_list_adapter_create_inner_snapshot ____________________ 408s 408s def test_list_adapter_create_inner_snapshot(): 408s 408s Example( 408s """\ 408s from inline_snapshot import snapshot 408s from dirty_equals import IsInt 408s 408s def test_list(): 408s 408s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(),4]),"not equal" 408s """ 408s > ).run_inline( 408s ["--inline-snapshot=create"], 408s changed_files=snapshot( 408s { 408s "test_something.py": """\ 408s from inline_snapshot import snapshot 408s from dirty_equals import IsInt 408s 408s def test_list(): 408s 408s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(3),4]),"not equal" 408s """ 408s } 408s ), 408s raises=snapshot(None), 408s ) 408s 408s tests/adapter/test_sequence.py:17: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 408s assert raises == f"{type(raised_exception).__name__}:\n" + str( 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 408s filename = PosixPath('/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/adapter/test_sequence.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot 408s from dirty_equals import IsInt 408s 408s def test_list(): 408s 408s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(),4]),"not equal" 408s 408s 408s run> pytest /tmp/tmptc1q6ll_/test_something.py 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 408s v() 408s File "/tmp/tmptc1q6ll_/test_something.py", line 6, in test_list 408s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(),4]),"not equal" 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 408s return self == other 408s ^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 280, in __eq__ 408s return _return(self._visible_value() == other) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_unmanaged.py", line 44, in __eq__ 408s return self.value == other 408s ^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 408s self._changes.append(next(it)) 408s ^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 408s new_code = self.context.file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s _____________________ test_list_adapter_fix_inner_snapshot _____________________ 408s 408s def test_list_adapter_fix_inner_snapshot(): 408s 408s Example( 408s """\ 408s from inline_snapshot import snapshot 408s from dirty_equals import IsInt 408s 408s def test_list(): 408s 408s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(8),4]),"not equal" 408s """ 408s > ).run_inline( 408s ["--inline-snapshot=fix"], 408s changed_files=snapshot( 408s { 408s "test_something.py": """\ 408s from inline_snapshot import snapshot 408s from dirty_equals import IsInt 408s 408s def test_list(): 408s 408s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(3),4]),"not equal" 408s """ 408s } 408s ), 408s raises=snapshot(None), 408s ) 408s 408s tests/adapter/test_sequence.py:46: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 408s assert raises == f"{type(raised_exception).__name__}:\n" + str( 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 408s filename = PosixPath('/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/adapter/test_sequence.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot 408s from dirty_equals import IsInt 408s 408s def test_list(): 408s 408s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(8),4]),"not equal" 408s 408s 408s run> pytest /tmp/tmpfmkqf2ri/test_something.py 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 408s v() 408s File "/tmp/tmpfmkqf2ri/test_something.py", line 6, in test_list 408s assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(8),4]),"not equal" 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 408s return self == other 408s ^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 280, in __eq__ 408s return _return(self._visible_value() == other) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_unmanaged.py", line 44, in __eq__ 408s return self.value == other 408s ^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 408s self._changes.append(next(it)) 408s ^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 408s new_code = self.context.file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s ________________________________ test_list_var _________________________________ 408s 408s def test_list_var(): 408s 408s Example( 408s """\ 408s from inline_snapshot import snapshot,Is 408s 408s def test_list(): 408s l=[1] 408s assert l == snapshot(l), "not equal" 408s """ 408s > ).run_inline( 408s ["--inline-snapshot=update"], 408s changed_files=snapshot( 408s { 408s "test_something.py": """\ 408s from inline_snapshot import snapshot,Is 408s 408s def test_list(): 408s l=[1] 408s assert l == snapshot([1]), "not equal" 408s """ 408s } 408s ), 408s ) 408s 408s tests/adapter/test_sequence.py:92: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s self = 408s args = ['--inline-snapshot=update'] 408s 408s def run_inline( 408s self, 408s args: list[str] = [], 408s *, 408s reported_categories: Snapshot[list[Category]] | None = None, 408s changed_files: Snapshot[dict[str, str]] | None = None, 408s report: Snapshot[str] | None = None, 408s raises: Snapshot[str] | None = None, 408s ) -> Example: 408s """Execute the example files in process and run every `test_*` 408s function. 408s 408s This is useful for fast test execution. 408s 408s Parameters: 408s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 408s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 408s changed_files: snapshot of files which are changed by this run. 408s raises: snapshot of the exception which is raised during the test execution. 408s It is required if your code raises an exception. 408s 408s Returns: 408s A new Example instance which contains the changed files. 408s """ 408s 408s parser = ArgumentParser() 408s 408s parser.add_argument( 408s "--inline-snapshot", 408s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 408s dest="inline_snapshot", 408s help="update specific snapshot values:\n" 408s "disable: disable the snapshot logic\n" 408s "short-report: show a short report\n" 408s "report: show a longer report with a diff report\n" 408s "review: allow to approve the changes interactive\n" 408s "create: creates snapshots which are currently not defined\n" 408s "update: update snapshots even if they are defined\n" 408s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 408s "fix: change snapshots which currently break your tests\n", 408s ) 408s parsed_args = parser.parse_args(args) 408s flags = (parsed_args.inline_snapshot or "").split(",") 408s 408s with TemporaryDirectory() as dir: 408s tmp_path = Path(dir) 408s 408s self._write_files(tmp_path) 408s 408s raised_exception = None 408s with snapshot_env(): 408s with ChangeRecorder().activate() as recorder: 408s _inline_snapshot._update_flags = Flags({*flags}) 408s inline_snapshot._external.storage = ( 408s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 408s ) 408s 408s try: 408s for filename in tmp_path.glob("*.py"): 408s globals: dict[str, Any] = {} 408s print("run> pytest", filename) 408s exec( 408s compile(filename.read_text("utf-8"), filename, "exec"), 408s globals, 408s ) 408s 408s # run all test_* functions 408s for k, v in globals.items(): 408s if k.startswith("test_") and callable(v): 408s v() 408s except Exception as e: 408s traceback.print_exc() 408s raised_exception = e 408s 408s finally: 408s _inline_snapshot._active = False 408s 408s changes = [] 408s for snapshot in _inline_snapshot.snapshots.values(): 408s changes += snapshot._changes() 408s 408s snapshot_flags = {change.flag for change in changes} 408s 408s apply_all( 408s [ 408s change 408s for change in changes 408s if change.flag in _inline_snapshot._update_flags.to_set() 408s ] 408s ) 408s recorder.fix_all() 408s 408s report_output = StringIO() 408s console = Console(file=report_output) 408s 408s # TODO: add all the report output here 408s report_problems(console) 408s 408s if reported_categories is not None: 408s assert sorted(snapshot_flags) == reported_categories 408s 408s if raised_exception is not None: 408s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 408s raised_exception 408s ) 408s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 408s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot,Is 408s 408s def test_list(): 408s l=[1] 408s assert l == snapshot(l), "not equal" 408s 408s 408s run> pytest /tmp/tmpz0dzy8ba/test_something.py 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 408s v() 408s File "/tmp/tmpz0dzy8ba/test_something.py", line 5, in test_list 408s assert l == snapshot(l), "not equal" 408s ^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 408s return self == other 408s ^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 408s self._changes.append(next(it)) 408s ^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py", line 52, in assign 408s result = yield from self.value_assign(old_value, old_node, new_value) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py", line 87, in value_assign 408s result = yield from adapter.assign(old_value, old_node, new_value) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 408s new_code = self.context.file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s __________________________ test_change_function_args ___________________________ 408s 408s check_change = .w at 0xf36fae38> 408s 408s def test_change_function_args(check_change): 408s 408s > check_change( 408s "f(a,b=2)", 408s lambda source, call: [ 408s Replace( 408s flag="fix", 408s file=source, 408s node=call.args[0], 408s new_code="22", 408s old_value=0, 408s new_value=0, 408s ) 408s ], 408s snapshot("f(22,b=2)"), 408s ) 408s 408s tests/test_change.py:48: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/test_change.py:37: in w 408s cr.virtual_write() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:244: in virtual_write 408s file.virtual_write() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:141: in virtual_write 408s self.source = self.new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 408s format_whole_file = enforce_formatting() or code == format_code( 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = 'f(a,b=2)' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_change_function_args0/test_0.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s test: f(a,b=2) 408s __________________________________ test_enum ___________________________________ 408s 408s check_update = .w at 0xf36fa988> 408s 408s def test_enum(check_update): 408s 408s assert ( 408s > check_update( 408s """ 408s from enum import Enum 408s 408s class color(Enum): 408s val="val" 408s 408s 408s assert [color.val] == snapshot() 408s 408s """, 408s flags="create", 408s ) 408s == snapshot( 408s """\ 408s 408s from enum import Enum 408s 408s class color(Enum): 408s val="val" 408s 408s 408s assert [color.val] == snapshot([color.val]) 408s 408s """ 408s ) 408s ) 408s 408s tests/test_code_repr.py:15: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:49: in w 408s s = source(source_code) 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_enum0/test_1.py:16: in 408s assert [color.val] == snapshot() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_enum0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s | 408s |from enum import Enum 408s | 408s |class color(Enum): 408s | val="val" 408s | 408s | 408s |assert [color.val] == snapshot() 408s | 408s _______________________ test_snapshot_generates_hasrepr ________________________ 408s 408s def test_snapshot_generates_hasrepr(): 408s 408s Example( 408s """\ 408s from inline_snapshot import snapshot 408s 408s class Thing: 408s def __repr__(self): 408s return "" 408s 408s def __eq__(self,other): 408s if not isinstance(other,Thing): 408s return NotImplemented 408s return True 408s 408s def test_thing(): 408s assert Thing() == snapshot() 408s 408s """ 408s > ).run_pytest( 408s ["--inline-snapshot=create"], 408s returncode=snapshot(0), 408s changed_files=snapshot( 408s { 408s "test_something.py": """\ 408s from inline_snapshot import snapshot 408s 408s from inline_snapshot import HasRepr 408s 408s class Thing: 408s def __repr__(self): 408s return "" 408s 408s def __eq__(self,other): 408s if not isinstance(other,Thing): 408s return NotImplemented 408s return True 408s 408s def test_thing(): 408s assert Thing() == snapshot(HasRepr(Thing, "")) 408s 408s \ 408s """ 408s } 408s ), 408s ).run_pytest( 408s ["--inline-snapshot=disable"], returncode=0 408s ).run_pytest( 408s returncode=0 408s ) 408s 408s tests/test_code_repr.py:63: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:297: in run_pytest 408s assert result.returncode == returncode 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '1 ' 408s filename = PosixPath('/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_code_repr.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot 408s 408s class Thing: 408s def __repr__(self): 408s return "" 408s 408s def __eq__(self,other): 408s if not isinstance(other,Thing): 408s return NotImplemented 408s return True 408s 408s def test_thing(): 408s assert Thing() == snapshot() 408s 408s 408s 408s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 408s stdout: 408s ============================= test session starts ============================== 408s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/tmprtyglpne 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_something.py F [100%] 408s 408s =================================== FAILURES =================================== 408s __________________________________ test_thing __________________________________ 408s 408s def test_thing(): 408s > assert Thing() == snapshot() 408s 408s test_something.py:13: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '', filename = PosixPath('/tmp/tmprtyglpne/test_something.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_something.py::test_thing - TypeError: CliRunner.__init__() got an... 408s ============================== 1 failed in 0.26s =============================== 408s 408s stderr: 408s 408s ____________________________ test_enum_in_dataclass ____________________________ 408s 408s check_update = .w at 0xf385d258> 408s 408s def test_enum_in_dataclass(check_update): 408s 408s assert ( 408s > check_update( 408s """ 408s from enum import Enum 408s from dataclasses import dataclass 408s 408s class color(Enum): 408s red="red" 408s blue="blue" 408s 408s @dataclass 408s class container: 408s bg: color=color.red 408s fg: color=color.blue 408s 408s assert container(bg=color.red,fg=color.red) == snapshot() 408s 408s """, 408s flags="create", 408s ) 408s == snapshot( 408s """\ 408s 408s from enum import Enum 408s from dataclasses import dataclass 408s 408s class color(Enum): 408s red="red" 408s blue="blue" 408s 408s @dataclass 408s class container: 408s bg: color=color.red 408s fg: color=color.blue 408s 408s assert container(bg=color.red,fg=color.red) == snapshot(container(fg=color.red)) 408s 408s """ 408s ) 408s ) 408s 408s tests/test_code_repr.py:106: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:49: in w 408s s = source(source_code) 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_enum_in_dataclass0/test_1.py:22: in 408s assert container(bg=color.red,fg=color.red) == snapshot() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_enum_in_dataclass0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s | 408s |from enum import Enum 408s |from dataclasses import dataclass 408s | 408s |class color(Enum): 408s | red="red" 408s | blue="blue" 408s | 408s |@dataclass 408s |class container: 408s | bg: color=color.red 408s | fg: color=color.blue 408s | 408s |assert container(bg=color.red,fg=color.red) == snapshot() 408s | 408s __________________________________ test_flag ___________________________________ 408s 408s check_update = .w at 0xf385d618> 408s 408s def test_flag(check_update): 408s 408s assert ( 408s > check_update( 408s """ 408s from enum import Flag, auto 408s 408s class Color(Flag): 408s red = auto() 408s green = auto() 408s blue = auto() 408s 408s assert Color.red | Color.blue == snapshot() 408s 408s """, 408s flags="create", 408s ) 408s == snapshot( 408s """\ 408s 408s from enum import Flag, auto 408s 408s class Color(Flag): 408s red = auto() 408s green = auto() 408s blue = auto() 408s 408s assert Color.red | Color.blue == snapshot(Color.red | Color.blue) 408s 408s """ 408s ) 408s ) 408s 408s tests/test_code_repr.py:150: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:49: in w 408s s = source(source_code) 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_flag0/test_1.py:17: in 408s assert Color.red | Color.blue == snapshot() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_flag0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s | 408s |from enum import Flag, auto 408s | 408s |class Color(Flag): 408s | red = auto() 408s | green = auto() 408s | blue = auto() 408s | 408s |assert Color.red | Color.blue == snapshot() 408s | 408s __________________________________ test_type ___________________________________ 408s 408s check_update = .w at 0xf385dd98> 408s 408s def test_type(check_update): 408s 408s assert ( 408s > check_update( 408s """\ 408s class Color: 408s pass 408s 408s assert [Color,int] == snapshot() 408s 408s """, 408s flags="create", 408s ) 408s == snapshot( 408s """\ 408s class Color: 408s pass 408s 408s assert [Color,int] == snapshot([Color, int]) 408s 408s """ 408s ) 408s ) 408s 408s tests/test_code_repr.py:184: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:49: in w 408s s = source(source_code) 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_type0/test_1.py:12: in 408s assert [Color,int] == snapshot() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_type0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |class Color: 408s | pass 408s | 408s |assert [Color,int] == snapshot() 408s | 408s ________________________________ test_qualname _________________________________ 408s 408s def test_qualname(): 408s 408s Example( 408s """\ 408s from enum import Enum 408s from inline_snapshot import snapshot 408s 408s 408s class Namespace: 408s class Color(Enum): 408s red="red" 408s 408s assert Namespace.Color.red == snapshot() 408s 408s """ 408s > ).run_inline( 408s ["--inline-snapshot=create"], 408s changed_files=snapshot( 408s { 408s "test_something.py": """\ 408s from enum import Enum 408s from inline_snapshot import snapshot 408s 408s 408s class Namespace: 408s class Color(Enum): 408s red="red" 408s 408s assert Namespace.Color.red == snapshot(Namespace.Color.red) 408s 408s \ 408s """ 408s } 408s ), 408s ).run_inline() 408s 408s tests/test_code_repr.py:221: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s self = 408s args = ['--inline-snapshot=create'] 408s 408s def run_inline( 408s self, 408s args: list[str] = [], 408s *, 408s reported_categories: Snapshot[list[Category]] | None = None, 408s changed_files: Snapshot[dict[str, str]] | None = None, 408s report: Snapshot[str] | None = None, 408s raises: Snapshot[str] | None = None, 408s ) -> Example: 408s """Execute the example files in process and run every `test_*` 408s function. 408s 408s This is useful for fast test execution. 408s 408s Parameters: 408s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 408s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 408s changed_files: snapshot of files which are changed by this run. 408s raises: snapshot of the exception which is raised during the test execution. 408s It is required if your code raises an exception. 408s 408s Returns: 408s A new Example instance which contains the changed files. 408s """ 408s 408s parser = ArgumentParser() 408s 408s parser.add_argument( 408s "--inline-snapshot", 408s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 408s dest="inline_snapshot", 408s help="update specific snapshot values:\n" 408s "disable: disable the snapshot logic\n" 408s "short-report: show a short report\n" 408s "report: show a longer report with a diff report\n" 408s "review: allow to approve the changes interactive\n" 408s "create: creates snapshots which are currently not defined\n" 408s "update: update snapshots even if they are defined\n" 408s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 408s "fix: change snapshots which currently break your tests\n", 408s ) 408s parsed_args = parser.parse_args(args) 408s flags = (parsed_args.inline_snapshot or "").split(",") 408s 408s with TemporaryDirectory() as dir: 408s tmp_path = Path(dir) 408s 408s self._write_files(tmp_path) 408s 408s raised_exception = None 408s with snapshot_env(): 408s with ChangeRecorder().activate() as recorder: 408s _inline_snapshot._update_flags = Flags({*flags}) 408s inline_snapshot._external.storage = ( 408s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 408s ) 408s 408s try: 408s for filename in tmp_path.glob("*.py"): 408s globals: dict[str, Any] = {} 408s print("run> pytest", filename) 408s exec( 408s compile(filename.read_text("utf-8"), filename, "exec"), 408s globals, 408s ) 408s 408s # run all test_* functions 408s for k, v in globals.items(): 408s if k.startswith("test_") and callable(v): 408s v() 408s except Exception as e: 408s traceback.print_exc() 408s raised_exception = e 408s 408s finally: 408s _inline_snapshot._active = False 408s 408s changes = [] 408s for snapshot in _inline_snapshot.snapshots.values(): 408s changes += snapshot._changes() 408s 408s snapshot_flags = {change.flag for change in changes} 408s 408s apply_all( 408s [ 408s change 408s for change in changes 408s if change.flag in _inline_snapshot._update_flags.to_set() 408s ] 408s ) 408s recorder.fix_all() 408s 408s report_output = StringIO() 408s console = Console(file=report_output) 408s 408s # TODO: add all the report output here 408s report_problems(console) 408s 408s if reported_categories is not None: 408s assert sorted(snapshot_flags) == reported_categories 408s 408s if raised_exception is not None: 408s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 408s raised_exception 408s ) 408s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 408s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from enum import Enum 408s from inline_snapshot import snapshot 408s 408s 408s class Namespace: 408s class Color(Enum): 408s red="red" 408s 408s assert Namespace.Color.red == snapshot() 408s 408s 408s 408s run> pytest /tmp/tmp8omxo91t/test_something.py 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 185, in run_inline 408s exec( 408s File "/tmp/tmp8omxo91t/test_something.py", line 9, in 408s assert Namespace.Color.red == snapshot() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 408s return self == other 408s ^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 408s self._changes.append(next(it)) 408s ^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 408s new_code = self.context.file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s ______________________________ test_invalid_repr _______________________________ 408s 408s check_update = .w at 0xf372f7a8> 408s 408s def test_invalid_repr(check_update): 408s assert ( 408s > check_update( 408s """\ 408s class Thing: 408s def __repr__(self): 408s return "+++" 408s 408s def __eq__(self,other): 408s if not isinstance(other,Thing): 408s return NotImplemented 408s return True 408s 408s assert Thing() == snapshot() 408s """, 408s flags="create", 408s ) 408s == snapshot( 408s """\ 408s class Thing: 408s def __repr__(self): 408s return "+++" 408s 408s def __eq__(self,other): 408s if not isinstance(other,Thing): 408s return NotImplemented 408s return True 408s 408s assert Thing() == snapshot(HasRepr(Thing, "+++")) 408s """ 408s ) 408s ) 408s 408s tests/test_code_repr.py:351: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:49: in w 408s s = source(source_code) 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_invalid_repr0/test_1.py:18: in 408s assert Thing() == snapshot() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_invalid_repr0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |class Thing: 408s | def __repr__(self): 408s | return "+++" 408s | 408s | def __eq__(self,other): 408s | if not isinstance(other,Thing): 408s | return NotImplemented 408s | return True 408s | 408s |assert Thing() == snapshot() 408s ____________________________ test_config_pyproject _____________________________ 408s 408s def test_config_pyproject(): 408s 408s Example( 408s { 408s **file_to_trim, 408s "pyproject.toml": """ 408s [tool.inline-snapshot] 408s default-flags = ["trim"] 408s """, 408s } 408s > ).run_pytest(changed_files=trimmed_files) 408s 408s tests/test_config.py:37: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s self = 408s args = [] 408s 408s def run_pytest( 408s self, 408s args: list[str] = [], 408s *, 408s term_columns=80, 408s env: dict[str, str] = {}, 408s changed_files: Snapshot[dict[str, str]] | None = None, 408s report: Snapshot[str] | None = None, 408s stderr: Snapshot[str] | None = None, 408s returncode: Snapshot[int] | None = None, 408s ) -> Example: 408s """Run pytest with the given args and env variables in an seperate 408s process. 408s 408s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 408s 408s Parameters: 408s args: pytest arguments like "--inline-snapshot=fix" 408s env: dict of environment variables 408s changed_files: snapshot of files which are changed by this run. 408s report: snapshot of the report at the end of the pytest run. 408s stderr: pytest stderr output 408s returncode: snapshot of the pytest returncode. 408s 408s Returns: 408s A new Example instance which contains the changed files. 408s """ 408s 408s with TemporaryDirectory() as dir: 408s tmp_path = Path(dir) 408s self._write_files(tmp_path) 408s 408s cmd = [sys.executable, "-m", "pytest", *args] 408s 408s command_env = dict(os.environ) 408s command_env["TERM"] = "unknown" 408s command_env["COLUMNS"] = str( 408s term_columns + 1 if platform.system() == "Windows" else term_columns 408s ) 408s command_env.pop("CI", None) 408s 408s command_env.update(env) 408s 408s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 408s 408s print("run>", *cmd) 408s print("stdout:") 408s print(result.stdout.decode()) 408s print("stderr:") 408s print(result.stderr.decode()) 408s 408s if returncode is not None: 408s assert result.returncode == returncode 408s 408s if stderr is not None: 408s assert result.stderr.decode() == stderr 408s 408s if report is not None: 408s 408s report_list = [] 408s record = False 408s for line in result.stdout.decode().splitlines(): 408s line = line.strip() 408s if line.startswith("===="): 408s record = False 408s 408s if record and line: 408s report_list.append(line) 408s 408s if line.startswith("====") and "inline snapshot" in line: 408s record = True 408s 408s report_str = "\n".join(report_list) 408s 408s assert normalize(report_str) == report, repr(report_str) 408s 408s if changed_files is not None: 408s current_files = {} 408s 408s for name, content in sorted(self._read_files(tmp_path).items()): 408s if name not in self.files or self.files[name] != content: 408s current_files[name] = content 408s > assert changed_files == current_files 408s E AssertionError: assert {'test_a.py':...napshot(2)\n'} == {} 408s E 408s E Left contains 1 more item: 408s E {'test_a.py': 'from inline_snapshot import snapshot\n' 408s E '\n' 408s E 'def test_a():\n' 408s E ' assert 1 <= snapshot(1)\n' 408s E ' assert 1 == snapshot(2)\n'} 408s E Use -v to get more diff 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_a.py 408s from inline_snapshot import snapshot 408s 408s def test_a(): 408s assert 1 <= snapshot(5) 408s assert 1 == snapshot(2) 408s 408s 408s file: pyproject.toml 408s 408s [tool.inline-snapshot] 408s default-flags = ["trim"] 408s 408s 408s run> /usr/bin/python3.12 -m pytest 408s stdout: 408s ============================= test session starts ============================== 408s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/tmpg9urbp5h 408s configfile: pyproject.toml 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_a.py F [100%] 408s 408s =================================== FAILURES =================================== 408s ____________________________________ test_a ____________________________________ 408s 408s def test_a(): 408s assert 1 <= snapshot(5) 408s > assert 1 == snapshot(2) 408s 408s test_a.py:5: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '1 ', filename = PosixPath('/tmp/tmpg9urbp5h/test_a.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 408s 408s stderr: 408s Traceback (most recent call last): 408s File "", line 198, in _run_module_as_main 408s File "", line 88, in _run_code 408s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 408s raise SystemExit(pytest.console_main()) 408s ^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 408s code = main() 408s ^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 408s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 408s res = hook_impl.function(*args) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 408s return wrap_session(config, _main) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 408s config.hook.pytest_sessionfinish( 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 408s teardown.send(result) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 408s self.config.hook.pytest_terminal_summary( 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 408s res = hook_impl.function(*args) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 408s for change in snapshot._changes(): 408s ^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 408s yield from self._value._get_changes() 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s _______________________________ test_config_env ________________________________ 408s 408s def test_config_env(): 408s > Example(file_to_trim).run_pytest( 408s env={"INLINE_SNAPSHOT_DEFAULT_FLAGS": "trim"}, changed_files=trimmed_files 408s ) 408s 408s tests/test_config.py:41: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s self = 408s args = [] 408s 408s def run_pytest( 408s self, 408s args: list[str] = [], 408s *, 408s term_columns=80, 408s env: dict[str, str] = {}, 408s changed_files: Snapshot[dict[str, str]] | None = None, 408s report: Snapshot[str] | None = None, 408s stderr: Snapshot[str] | None = None, 408s returncode: Snapshot[int] | None = None, 408s ) -> Example: 408s """Run pytest with the given args and env variables in an seperate 408s process. 408s 408s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 408s 408s Parameters: 408s args: pytest arguments like "--inline-snapshot=fix" 408s env: dict of environment variables 408s changed_files: snapshot of files which are changed by this run. 408s report: snapshot of the report at the end of the pytest run. 408s stderr: pytest stderr output 408s returncode: snapshot of the pytest returncode. 408s 408s Returns: 408s A new Example instance which contains the changed files. 408s """ 408s 408s with TemporaryDirectory() as dir: 408s tmp_path = Path(dir) 408s self._write_files(tmp_path) 408s 408s cmd = [sys.executable, "-m", "pytest", *args] 408s 408s command_env = dict(os.environ) 408s command_env["TERM"] = "unknown" 408s command_env["COLUMNS"] = str( 408s term_columns + 1 if platform.system() == "Windows" else term_columns 408s ) 408s command_env.pop("CI", None) 408s 408s command_env.update(env) 408s 408s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 408s 408s print("run>", *cmd) 408s print("stdout:") 408s print(result.stdout.decode()) 408s print("stderr:") 408s print(result.stderr.decode()) 408s 408s if returncode is not None: 408s assert result.returncode == returncode 408s 408s if stderr is not None: 408s assert result.stderr.decode() == stderr 408s 408s if report is not None: 408s 408s report_list = [] 408s record = False 408s for line in result.stdout.decode().splitlines(): 408s line = line.strip() 408s if line.startswith("===="): 408s record = False 408s 408s if record and line: 408s report_list.append(line) 408s 408s if line.startswith("====") and "inline snapshot" in line: 408s record = True 408s 408s report_str = "\n".join(report_list) 408s 408s assert normalize(report_str) == report, repr(report_str) 408s 408s if changed_files is not None: 408s current_files = {} 408s 408s for name, content in sorted(self._read_files(tmp_path).items()): 408s if name not in self.files or self.files[name] != content: 408s current_files[name] = content 408s > assert changed_files == current_files 408s E AssertionError: assert {'test_a.py':...napshot(2)\n'} == {} 408s E 408s E Left contains 1 more item: 408s E {'test_a.py': 'from inline_snapshot import snapshot\n' 408s E '\n' 408s E 'def test_a():\n' 408s E ' assert 1 <= snapshot(1)\n' 408s E ' assert 1 == snapshot(2)\n'} 408s E Use -v to get more diff 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_a.py 408s from inline_snapshot import snapshot 408s 408s def test_a(): 408s assert 1 <= snapshot(5) 408s assert 1 == snapshot(2) 408s 408s 408s run> /usr/bin/python3.12 -m pytest 408s stdout: 408s ============================= test session starts ============================== 408s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/tmp5rohqogv 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_a.py F [100%] 408s 408s =================================== FAILURES =================================== 408s ____________________________________ test_a ____________________________________ 408s 408s def test_a(): 408s assert 1 <= snapshot(5) 408s > assert 1 == snapshot(2) 408s 408s test_a.py:5: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '1 ', filename = PosixPath('/tmp/tmp5rohqogv/test_a.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 408s 408s stderr: 408s Traceback (most recent call last): 408s File "", line 198, in _run_module_as_main 408s File "", line 88, in _run_code 408s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 408s raise SystemExit(pytest.console_main()) 408s ^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 408s code = main() 408s ^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 408s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 408s res = hook_impl.function(*args) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 408s return wrap_session(config, _main) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 408s config.hook.pytest_sessionfinish( 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 408s teardown.send(result) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 408s self.config.hook.pytest_terminal_summary( 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 408s res = hook_impl.function(*args) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 408s for change in snapshot._changes(): 408s ^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 408s yield from self._value._get_changes() 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s ________________________________ test_shortcuts ________________________________ 408s 408s def test_shortcuts(): 408s 408s Example( 408s { 408s **file_to_trim, 408s "pyproject.toml": """ 408s [tool.inline-snapshot.shortcuts] 408s strim=["trim"] 408s """, 408s } 408s > ).run_pytest(["--strim"], changed_files=trimmed_files) 408s 408s tests/test_config.py:56: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s self = 408s args = ['--strim'] 408s 408s def run_pytest( 408s self, 408s args: list[str] = [], 408s *, 408s term_columns=80, 408s env: dict[str, str] = {}, 408s changed_files: Snapshot[dict[str, str]] | None = None, 408s report: Snapshot[str] | None = None, 408s stderr: Snapshot[str] | None = None, 408s returncode: Snapshot[int] | None = None, 408s ) -> Example: 408s """Run pytest with the given args and env variables in an seperate 408s process. 408s 408s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 408s 408s Parameters: 408s args: pytest arguments like "--inline-snapshot=fix" 408s env: dict of environment variables 408s changed_files: snapshot of files which are changed by this run. 408s report: snapshot of the report at the end of the pytest run. 408s stderr: pytest stderr output 408s returncode: snapshot of the pytest returncode. 408s 408s Returns: 408s A new Example instance which contains the changed files. 408s """ 408s 408s with TemporaryDirectory() as dir: 408s tmp_path = Path(dir) 408s self._write_files(tmp_path) 408s 408s cmd = [sys.executable, "-m", "pytest", *args] 408s 408s command_env = dict(os.environ) 408s command_env["TERM"] = "unknown" 408s command_env["COLUMNS"] = str( 408s term_columns + 1 if platform.system() == "Windows" else term_columns 408s ) 408s command_env.pop("CI", None) 408s 408s command_env.update(env) 408s 408s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 408s 408s print("run>", *cmd) 408s print("stdout:") 408s print(result.stdout.decode()) 408s print("stderr:") 408s print(result.stderr.decode()) 408s 408s if returncode is not None: 408s assert result.returncode == returncode 408s 408s if stderr is not None: 408s assert result.stderr.decode() == stderr 408s 408s if report is not None: 408s 408s report_list = [] 408s record = False 408s for line in result.stdout.decode().splitlines(): 408s line = line.strip() 408s if line.startswith("===="): 408s record = False 408s 408s if record and line: 408s report_list.append(line) 408s 408s if line.startswith("====") and "inline snapshot" in line: 408s record = True 408s 408s report_str = "\n".join(report_list) 408s 408s assert normalize(report_str) == report, repr(report_str) 408s 408s if changed_files is not None: 408s current_files = {} 408s 408s for name, content in sorted(self._read_files(tmp_path).items()): 408s if name not in self.files or self.files[name] != content: 408s current_files[name] = content 408s > assert changed_files == current_files 408s E AssertionError: assert {'test_a.py':...napshot(2)\n'} == {} 408s E 408s E Left contains 1 more item: 408s E {'test_a.py': 'from inline_snapshot import snapshot\n' 408s E '\n' 408s E 'def test_a():\n' 408s E ' assert 1 <= snapshot(1)\n' 408s E ' assert 1 == snapshot(2)\n'} 408s E Use -v to get more diff 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_a.py 408s from inline_snapshot import snapshot 408s 408s def test_a(): 408s assert 1 <= snapshot(5) 408s assert 1 == snapshot(2) 408s 408s 408s file: pyproject.toml 408s 408s [tool.inline-snapshot.shortcuts] 408s strim=["trim"] 408s 408s 408s run> /usr/bin/python3.12 -m pytest --strim 408s stdout: 408s ============================= test session starts ============================== 408s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/tmpnyfw7ktr 408s configfile: pyproject.toml 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_a.py F [100%] 408s 408s =================================== FAILURES =================================== 408s ____________________________________ test_a ____________________________________ 408s 408s def test_a(): 408s assert 1 <= snapshot(5) 408s > assert 1 == snapshot(2) 408s 408s test_a.py:5: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '1 ', filename = PosixPath('/tmp/tmpnyfw7ktr/test_a.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 408s 408s stderr: 408s Traceback (most recent call last): 408s File "", line 198, in _run_module_as_main 408s File "", line 88, in _run_code 408s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 408s raise SystemExit(pytest.console_main()) 408s ^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 408s code = main() 408s ^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 408s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 408s res = hook_impl.function(*args) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 408s return wrap_session(config, _main) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 408s config.hook.pytest_sessionfinish( 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 408s teardown.send(result) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 408s self.config.hook.pytest_terminal_summary( 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 408s res = hook_impl.function(*args) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 408s for change in snapshot._changes(): 408s ^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 408s yield from self._value._get_changes() 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s ____________________________ test_default_shortcuts ____________________________ 408s 408s def test_default_shortcuts(): 408s 408s Example( 408s { 408s **file_to_trim, 408s "pyproject.toml": """ 408s """, 408s } 408s > ).run_pytest( 408s ["--fix"], 408s changed_files=snapshot( 408s { 408s "test_a.py": """\ 408s from inline_snapshot import snapshot 408s 408s def test_a(): 408s assert 1 <= snapshot(5) 408s assert 1 == snapshot(1) 408s """ 408s } 408s ), 408s ) 408s 408s tests/test_config.py:67: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s self = 408s args = ['--fix'] 408s 408s def run_pytest( 408s self, 408s args: list[str] = [], 408s *, 408s term_columns=80, 408s env: dict[str, str] = {}, 408s changed_files: Snapshot[dict[str, str]] | None = None, 408s report: Snapshot[str] | None = None, 408s stderr: Snapshot[str] | None = None, 408s returncode: Snapshot[int] | None = None, 408s ) -> Example: 408s """Run pytest with the given args and env variables in an seperate 408s process. 408s 408s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 408s 408s Parameters: 408s args: pytest arguments like "--inline-snapshot=fix" 408s env: dict of environment variables 408s changed_files: snapshot of files which are changed by this run. 408s report: snapshot of the report at the end of the pytest run. 408s stderr: pytest stderr output 408s returncode: snapshot of the pytest returncode. 408s 408s Returns: 408s A new Example instance which contains the changed files. 408s """ 408s 408s with TemporaryDirectory() as dir: 408s tmp_path = Path(dir) 408s self._write_files(tmp_path) 408s 408s cmd = [sys.executable, "-m", "pytest", *args] 408s 408s command_env = dict(os.environ) 408s command_env["TERM"] = "unknown" 408s command_env["COLUMNS"] = str( 408s term_columns + 1 if platform.system() == "Windows" else term_columns 408s ) 408s command_env.pop("CI", None) 408s 408s command_env.update(env) 408s 408s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 408s 408s print("run>", *cmd) 408s print("stdout:") 408s print(result.stdout.decode()) 408s print("stderr:") 408s print(result.stderr.decode()) 408s 408s if returncode is not None: 408s assert result.returncode == returncode 408s 408s if stderr is not None: 408s assert result.stderr.decode() == stderr 408s 408s if report is not None: 408s 408s report_list = [] 408s record = False 408s for line in result.stdout.decode().splitlines(): 408s line = line.strip() 408s if line.startswith("===="): 408s record = False 408s 408s if record and line: 408s report_list.append(line) 408s 408s if line.startswith("====") and "inline snapshot" in line: 408s record = True 408s 408s report_str = "\n".join(report_list) 408s 408s assert normalize(report_str) == report, repr(report_str) 408s 408s if changed_files is not None: 408s current_files = {} 408s 408s for name, content in sorted(self._read_files(tmp_path).items()): 408s if name not in self.files or self.files[name] != content: 408s current_files[name] = content 408s > assert changed_files == current_files 408s E AssertionError: assert {'test_a.py':...napshot(1)\n'} == {} 408s E 408s E Left contains 1 more item: 408s E {'test_a.py': 'from inline_snapshot import snapshot\n' 408s E '\n' 408s E 'def test_a():\n' 408s E ' assert 1 <= snapshot(5)\n' 408s E ' assert 1 == snapshot(1)\n'} 408s E Use -v to get more diff 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_a.py 408s from inline_snapshot import snapshot 408s 408s def test_a(): 408s assert 1 <= snapshot(5) 408s assert 1 == snapshot(2) 408s 408s 408s file: pyproject.toml 408s 408s 408s 408s run> /usr/bin/python3.12 -m pytest --fix 408s stdout: 408s ============================= test session starts ============================== 408s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/tmpziow45_8 408s configfile: pyproject.toml 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_a.py F [100%] 408s 408s =================================== FAILURES =================================== 408s ____________________________________ test_a ____________________________________ 408s 408s def test_a(): 408s assert 1 <= snapshot(5) 408s > assert 1 == snapshot(2) 408s 408s test_a.py:5: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '1 ', filename = PosixPath('/tmp/tmpziow45_8/test_a.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 408s 408s stderr: 408s Traceback (most recent call last): 408s File "", line 198, in _run_module_as_main 408s File "", line 88, in _run_code 408s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 408s raise SystemExit(pytest.console_main()) 408s ^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 408s code = main() 408s ^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 408s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 408s res = hook_impl.function(*args) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 408s return wrap_session(config, _main) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 408s config.hook.pytest_sessionfinish( 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 408s teardown.send(result) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 408s self.config.hook.pytest_terminal_summary( 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 408s res = hook_impl.function(*args) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 408s for change in snapshot._changes(): 408s ^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 408s yield from self._value._get_changes() 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s _______________________ test_compare_dirty_equals_twice ________________________ 408s 408s def test_compare_dirty_equals_twice() -> None: 408s 408s Example( 408s """ 408s from dirty_equals import IsStr 408s from inline_snapshot import snapshot 408s 408s for x in 'ab': 408s assert x == snapshot(IsStr()) 408s assert [x,5] == snapshot([IsStr(),3]) 408s assert {'a':x,'b':5} == snapshot({'a':IsStr(),'b':3}) 408s 408s """ 408s > ).run_inline( 408s ["--inline-snapshot=fix"], 408s changed_files=snapshot( 408s { 408s "test_something.py": """\ 408s 408s from dirty_equals import IsStr 408s from inline_snapshot import snapshot 408s 408s for x in 'ab': 408s assert x == snapshot(IsStr()) 408s assert [x,5] == snapshot([IsStr(),5]) 408s assert {'a':x,'b':5} == snapshot({'a':IsStr(),'b':5}) 408s 408s """ 408s } 408s ), 408s ) 408s 408s tests/test_dirty_equals.py:47: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s self = 408s args = ['--inline-snapshot=fix'] 408s 408s def run_inline( 408s self, 408s args: list[str] = [], 408s *, 408s reported_categories: Snapshot[list[Category]] | None = None, 408s changed_files: Snapshot[dict[str, str]] | None = None, 408s report: Snapshot[str] | None = None, 408s raises: Snapshot[str] | None = None, 408s ) -> Example: 408s """Execute the example files in process and run every `test_*` 408s function. 408s 408s This is useful for fast test execution. 408s 408s Parameters: 408s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 408s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 408s changed_files: snapshot of files which are changed by this run. 408s raises: snapshot of the exception which is raised during the test execution. 408s It is required if your code raises an exception. 408s 408s Returns: 408s A new Example instance which contains the changed files. 408s """ 408s 408s parser = ArgumentParser() 408s 408s parser.add_argument( 408s "--inline-snapshot", 408s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 408s dest="inline_snapshot", 408s help="update specific snapshot values:\n" 408s "disable: disable the snapshot logic\n" 408s "short-report: show a short report\n" 408s "report: show a longer report with a diff report\n" 408s "review: allow to approve the changes interactive\n" 408s "create: creates snapshots which are currently not defined\n" 408s "update: update snapshots even if they are defined\n" 408s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 408s "fix: change snapshots which currently break your tests\n", 408s ) 408s parsed_args = parser.parse_args(args) 408s flags = (parsed_args.inline_snapshot or "").split(",") 408s 408s with TemporaryDirectory() as dir: 408s tmp_path = Path(dir) 408s 408s self._write_files(tmp_path) 408s 408s raised_exception = None 408s with snapshot_env(): 408s with ChangeRecorder().activate() as recorder: 408s _inline_snapshot._update_flags = Flags({*flags}) 408s inline_snapshot._external.storage = ( 408s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 408s ) 408s 408s try: 408s for filename in tmp_path.glob("*.py"): 408s globals: dict[str, Any] = {} 408s print("run> pytest", filename) 408s exec( 408s compile(filename.read_text("utf-8"), filename, "exec"), 408s globals, 408s ) 408s 408s # run all test_* functions 408s for k, v in globals.items(): 408s if k.startswith("test_") and callable(v): 408s v() 408s except Exception as e: 408s traceback.print_exc() 408s raised_exception = e 408s 408s finally: 408s _inline_snapshot._active = False 408s 408s changes = [] 408s for snapshot in _inline_snapshot.snapshots.values(): 408s changes += snapshot._changes() 408s 408s snapshot_flags = {change.flag for change in changes} 408s 408s apply_all( 408s [ 408s change 408s for change in changes 408s if change.flag in _inline_snapshot._update_flags.to_set() 408s ] 408s ) 408s recorder.fix_all() 408s 408s report_output = StringIO() 408s console = Console(file=report_output) 408s 408s # TODO: add all the report output here 408s report_problems(console) 408s 408s if reported_categories is not None: 408s assert sorted(snapshot_flags) == reported_categories 408s 408s if raised_exception is not None: 408s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 408s raised_exception 408s ) 408s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 408s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s 408s from dirty_equals import IsStr 408s from inline_snapshot import snapshot 408s 408s for x in 'ab': 408s assert x == snapshot(IsStr()) 408s assert [x,5] == snapshot([IsStr(),3]) 408s assert {'a':x,'b':5} == snapshot({'a':IsStr(),'b':3}) 408s 408s 408s 408s run> pytest /tmp/tmp82tj3hs6/test_something.py 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 185, in run_inline 408s exec( 408s File "/tmp/tmp82tj3hs6/test_something.py", line 7, in 408s assert [x,5] == snapshot([IsStr(),3]) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 408s return self == other 408s ^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 408s self._changes.append(next(it)) 408s ^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py", line 79, in assign 408s v = yield from self.get_adapter( 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 408s new_code = self.context.file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s _____________________ test_dirty_equals_with_changing_args _____________________ 408s 408s def test_dirty_equals_with_changing_args() -> None: 408s 408s Example( 408s """\ 408s from dirty_equals import IsInt 408s from inline_snapshot import snapshot 408s 408s def test_number(): 408s 408s for i in range(5): 408s assert ["a",i] == snapshot(["e",IsInt(gt=i-1,lt=i+1)]) 408s 408s """ 408s > ).run_inline( 408s ["--inline-snapshot=fix"], 408s changed_files=snapshot( 408s { 408s "test_something.py": """\ 408s from dirty_equals import IsInt 408s from inline_snapshot import snapshot 408s 408s def test_number(): 408s 408s for i in range(5): 408s assert ["a",i] == snapshot(["a",IsInt(gt=i-1,lt=i+1)]) 408s 408s """ 408s } 408s ), 408s ) 408s 408s tests/test_dirty_equals.py:138: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s self = 408s args = ['--inline-snapshot=fix'] 408s 408s def run_inline( 408s self, 408s args: list[str] = [], 408s *, 408s reported_categories: Snapshot[list[Category]] | None = None, 408s changed_files: Snapshot[dict[str, str]] | None = None, 408s report: Snapshot[str] | None = None, 408s raises: Snapshot[str] | None = None, 408s ) -> Example: 408s """Execute the example files in process and run every `test_*` 408s function. 408s 408s This is useful for fast test execution. 408s 408s Parameters: 408s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 408s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 408s changed_files: snapshot of files which are changed by this run. 408s raises: snapshot of the exception which is raised during the test execution. 408s It is required if your code raises an exception. 408s 408s Returns: 408s A new Example instance which contains the changed files. 408s """ 408s 408s parser = ArgumentParser() 408s 408s parser.add_argument( 408s "--inline-snapshot", 408s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 408s dest="inline_snapshot", 408s help="update specific snapshot values:\n" 408s "disable: disable the snapshot logic\n" 408s "short-report: show a short report\n" 408s "report: show a longer report with a diff report\n" 408s "review: allow to approve the changes interactive\n" 408s "create: creates snapshots which are currently not defined\n" 408s "update: update snapshots even if they are defined\n" 408s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 408s "fix: change snapshots which currently break your tests\n", 408s ) 408s parsed_args = parser.parse_args(args) 408s flags = (parsed_args.inline_snapshot or "").split(",") 408s 408s with TemporaryDirectory() as dir: 408s tmp_path = Path(dir) 408s 408s self._write_files(tmp_path) 408s 408s raised_exception = None 408s with snapshot_env(): 408s with ChangeRecorder().activate() as recorder: 408s _inline_snapshot._update_flags = Flags({*flags}) 408s inline_snapshot._external.storage = ( 408s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 408s ) 408s 408s try: 408s for filename in tmp_path.glob("*.py"): 408s globals: dict[str, Any] = {} 408s print("run> pytest", filename) 408s exec( 408s compile(filename.read_text("utf-8"), filename, "exec"), 408s globals, 408s ) 408s 408s # run all test_* functions 408s for k, v in globals.items(): 408s if k.startswith("test_") and callable(v): 408s v() 408s except Exception as e: 408s traceback.print_exc() 408s raised_exception = e 408s 408s finally: 408s _inline_snapshot._active = False 408s 408s changes = [] 408s for snapshot in _inline_snapshot.snapshots.values(): 408s changes += snapshot._changes() 408s 408s snapshot_flags = {change.flag for change in changes} 408s 408s apply_all( 408s [ 408s change 408s for change in changes 408s if change.flag in _inline_snapshot._update_flags.to_set() 408s ] 408s ) 408s recorder.fix_all() 408s 408s report_output = StringIO() 408s console = Console(file=report_output) 408s 408s # TODO: add all the report output here 408s report_problems(console) 408s 408s if reported_categories is not None: 408s assert sorted(snapshot_flags) == reported_categories 408s 408s if raised_exception is not None: 408s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 408s raised_exception 408s ) 408s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 408s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from dirty_equals import IsInt 408s from inline_snapshot import snapshot 408s 408s def test_number(): 408s 408s for i in range(5): 408s assert ["a",i] == snapshot(["e",IsInt(gt=i-1,lt=i+1)]) 408s 408s 408s 408s run> pytest /tmp/tmpwl_jpxrm/test_something.py 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 408s v() 408s File "/tmp/tmpwl_jpxrm/test_something.py", line 7, in test_number 408s assert ["a",i] == snapshot(["e",IsInt(gt=i-1,lt=i+1)]) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 408s return self == other 408s ^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 408s self._changes.append(next(it)) 408s ^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py", line 79, in assign 408s v = yield from self.get_adapter( 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 408s new_code = self.context.file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s _________________________________ test_example _________________________________ 408s 408s def test_example(): 408s 408s e = Example( 408s { 408s "test_a.py": """ 408s from inline_snapshot import snapshot 408s 408s def test_a(): 408s assert 1==snapshot(2) 408s """, 408s "test_b.py": "1+1", 408s }, 408s ) 408s 408s e.run_pytest( 408s ["--inline-snapshot=create,fix"], 408s ) 408s 408s > e.run_inline( 408s ["--inline-snapshot=fix"], 408s reported_categories=snapshot(["fix"]), 408s ).run_inline( 408s ["--inline-snapshot=fix"], 408s changed_files=snapshot({}), 408s ) 408s 408s tests/test_example.py:23: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s self = 408s args = ['--inline-snapshot=fix'] 408s 408s def run_inline( 408s self, 408s args: list[str] = [], 408s *, 408s reported_categories: Snapshot[list[Category]] | None = None, 408s changed_files: Snapshot[dict[str, str]] | None = None, 408s report: Snapshot[str] | None = None, 408s raises: Snapshot[str] | None = None, 408s ) -> Example: 408s """Execute the example files in process and run every `test_*` 408s function. 408s 408s This is useful for fast test execution. 408s 408s Parameters: 408s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 408s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 408s changed_files: snapshot of files which are changed by this run. 408s raises: snapshot of the exception which is raised during the test execution. 408s It is required if your code raises an exception. 408s 408s Returns: 408s A new Example instance which contains the changed files. 408s """ 408s 408s parser = ArgumentParser() 408s 408s parser.add_argument( 408s "--inline-snapshot", 408s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 408s dest="inline_snapshot", 408s help="update specific snapshot values:\n" 408s "disable: disable the snapshot logic\n" 408s "short-report: show a short report\n" 408s "report: show a longer report with a diff report\n" 408s "review: allow to approve the changes interactive\n" 408s "create: creates snapshots which are currently not defined\n" 408s "update: update snapshots even if they are defined\n" 408s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 408s "fix: change snapshots which currently break your tests\n", 408s ) 408s parsed_args = parser.parse_args(args) 408s flags = (parsed_args.inline_snapshot or "").split(",") 408s 408s with TemporaryDirectory() as dir: 408s tmp_path = Path(dir) 408s 408s self._write_files(tmp_path) 408s 408s raised_exception = None 408s with snapshot_env(): 408s with ChangeRecorder().activate() as recorder: 408s _inline_snapshot._update_flags = Flags({*flags}) 408s inline_snapshot._external.storage = ( 408s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 408s ) 408s 408s try: 408s for filename in tmp_path.glob("*.py"): 408s globals: dict[str, Any] = {} 408s print("run> pytest", filename) 408s exec( 408s compile(filename.read_text("utf-8"), filename, "exec"), 408s globals, 408s ) 408s 408s # run all test_* functions 408s for k, v in globals.items(): 408s if k.startswith("test_") and callable(v): 408s v() 408s except Exception as e: 408s traceback.print_exc() 408s raised_exception = e 408s 408s finally: 408s _inline_snapshot._active = False 408s 408s changes = [] 408s for snapshot in _inline_snapshot.snapshots.values(): 408s changes += snapshot._changes() 408s 408s snapshot_flags = {change.flag for change in changes} 408s 408s apply_all( 408s [ 408s change 408s for change in changes 408s if change.flag in _inline_snapshot._update_flags.to_set() 408s ] 408s ) 408s recorder.fix_all() 408s 408s report_output = StringIO() 408s console = Console(file=report_output) 408s 408s # TODO: add all the report output here 408s report_problems(console) 408s 408s if reported_categories is not None: 408s > assert sorted(snapshot_flags) == reported_categories 408s E AssertionError: assert [] == ['fix'] 408s E 408s E Right contains one more item: 'fix' 408s E Use -v to get more diff 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:223: AssertionError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_a.py 408s 408s from inline_snapshot import snapshot 408s 408s def test_a(): 408s assert 1==snapshot(2) 408s 408s 408s file: test_b.py 408s 1+1 408s 408s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create,fix 408s stdout: 408s ============================= test session starts ============================== 408s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/tmpda072882 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_a.py F [100%] 408s 408s =================================== FAILURES =================================== 408s ____________________________________ test_a ____________________________________ 408s 408s def test_a(): 408s > assert 1==snapshot(2) 408s 408s test_a.py:5: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '1 ', filename = PosixPath('/tmp/tmpda072882/test_a.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 408s ============================== 1 failed in 0.26s =============================== 408s 408s stderr: 408s 408s file: test_a.py 408s 408s from inline_snapshot import snapshot 408s 408s def test_a(): 408s assert 1==snapshot(2) 408s 408s 408s file: test_b.py 408s 1+1 408s 408s run> pytest /tmp/tmpzk83f4nw/test_a.py 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 408s v() 408s File "/tmp/tmpzk83f4nw/test_a.py", line 5, in test_a 408s assert 1==snapshot(2) 408s ^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 408s return self == other 408s ^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 408s self._changes.append(next(it)) 408s ^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 408s new_code = self.context.file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s __________________________________ test_basic __________________________________ 408s 408s check_update = .w at 0xf351f938> 408s 408s def test_basic(check_update): 408s > assert check_update( 408s "assert outsource('text') == snapshot()", flags="create" 408s ) == snapshot( 408s "assert outsource('text') == snapshot(external(\"982d9e3eb996*.txt\"))" 408s ) 408s 408s tests/test_external.py:12: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:49: in w 408s s = source(source_code) 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_basic0/test_1.py:9: in 408s assert outsource('text') == snapshot() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_basic0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert outsource('text') == snapshot() 408s _________________________________ test_persist _________________________________ 408s 408s project = .Project object at 0xf35451e0> 408s 408s def test_persist(project): 408s 408s project.setup( 408s """\ 408s from inline_snapshot import external 408s 408s def test_something(): 408s assert "hello" == snapshot(external("bbbbb*.txt")) 408s assert 2 == snapshot(1+1) 408s """ 408s ) 408s 408s result = project.run("--inline-snapshot=update") 408s 408s assert project.storage() == snapshot([]) 408s 408s > assert project.source == snapshot( 408s """\ 408s from inline_snapshot import external 408s 408s def test_something(): 408s assert "hello" == snapshot(external("bbbbb*.txt")) 408s assert 2 == snapshot(2) 408s """ 408s ) 408s 408s /tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_external.py:78: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '"""\\\nfrom inline_snapshot import external\n\ndef test_something():\n assert "hello" == snapshot(external("bbbbb*.txt"))\n assert 2 == snapshot(1+1)\n"""' 408s filename = PosixPath('/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_external.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s write code: 408s # äöß 🐍 408s from inline_snapshot import snapshot 408s from inline_snapshot import outsource 408s from inline_snapshot import external 408s 408s def test_something(): 408s assert "hello" == snapshot(external("bbbbb*.txt")) 408s assert 2 == snapshot(1+1) 408s 408s running: pytest --inline-snapshot=update 408s in: /tmp/pytest-of-ubuntu/pytest-0/test_persist0 408s ============================= test session starts ============================== 408s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_persist0 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_file.py F [100%] 408s 408s =================================== FAILURES =================================== 408s ________________________________ test_something ________________________________ 408s 408s def test_something(): 408s > assert "hello" == snapshot(external("bbbbb*.txt")) 408s 408s test_file.py:7: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = "'hello'" 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_persist0/test_file.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_file.py::test_something - TypeError: CliRunner.__init__() got an ... 408s ============================== 1 failed in 0.33s =============================== 408s _________________________ test_pytest_compare_external _________________________ 408s 408s project = .Project object at 0xf353c660> 408s 408s def test_pytest_compare_external(project): 408s project.setup( 408s """\ 408s from inline_snapshot import external 408s 408s def test_a(): 408s assert outsource("test") == snapshot( 408s external("9f86d081884c*.txt") 408s ) 408s 408s assert outsource("test2") == snapshot( 408s external("9f86d081884c*.txt") 408s ) 408s """ 408s ) 408s 408s result = project.run() 408s 408s > assert result.errorLines() == snapshot( 408s """\ 408s > assert outsource("test2") == snapshot( 408s E AssertionError: assert 'test2' == 'test' 408s E ⏎ 408s E - test 408s E + test2 408s E ? + 408s """ 408s ) 408s 408s /tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_external.py:123: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '"""\\\n> assert outsource("test2") == snapshot(\n> runner = CliRunner(mix_stderr=False)\nE TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\n"""' 408s filename = PosixPath('/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_external.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s write code: 408s # äöß 🐍 408s from inline_snapshot import snapshot 408s from inline_snapshot import outsource 408s from inline_snapshot import external 408s 408s def test_a(): 408s assert outsource("test") == snapshot( 408s external("9f86d081884c*.txt") 408s ) 408s 408s assert outsource("test2") == snapshot( 408s external("9f86d081884c*.txt") 408s ) 408s 408s running: pytest 408s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external0 408s ============================= test session starts ============================== 408s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external0 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_file.py F [100%] 408s 408s =================================== FAILURES =================================== 408s ____________________________________ test_a ____________________________________ 408s 408s def test_a(): 408s assert outsource("test") == snapshot( 408s external("9f86d081884c*.txt") 408s ) 408s 408s > assert outsource("test2") == snapshot( 408s external("9f86d081884c*.txt") 408s ) 408s 408s test_file.py:11: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = 'external ("60303ae22b99*.txt")' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external0/test_file.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 408s ============================== 1 failed in 0.34s =============================== 408s ______________________ test_pytest_compare_external_bytes ______________________ 408s 408s project = .Project object at 0xf34280d8> 408s 408s def test_pytest_compare_external_bytes(project): 408s project.setup( 408s """\ 408s from inline_snapshot import external 408s 408s def test_a(): 408s assert outsource(b"test") == snapshot( 408s external("9f86d081884c*.bin") 408s ) 408s 408s assert outsource(b"test2") == snapshot( 408s external("9f86d081884c*.bin") 408s ) 408s """ 408s ) 408s 408s result = project.run() 408s 408s > assert result.errorLines() == snapshot( 408s """\ 408s > assert outsource(b"test2") == snapshot( 408s E AssertionError: assert b'test2' == b'test' 408s E ⏎ 408s E Use -v to get more diff 408s """ 408s ) 408s 408s /tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_external.py:153: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s 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"""' 408s filename = PosixPath('/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_external.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s write code: 408s # äöß 🐍 408s from inline_snapshot import snapshot 408s from inline_snapshot import outsource 408s from inline_snapshot import external 408s 408s def test_a(): 408s assert outsource(b"test") == snapshot( 408s external("9f86d081884c*.bin") 408s ) 408s 408s assert outsource(b"test2") == snapshot( 408s external("9f86d081884c*.bin") 408s ) 408s 408s running: pytest 408s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external_bytes0 408s ============================= test session starts ============================== 408s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external_bytes0 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_file.py F [100%] 408s 408s =================================== FAILURES =================================== 408s ____________________________________ test_a ____________________________________ 408s 408s def test_a(): 408s assert outsource(b"test") == snapshot( 408s external("9f86d081884c*.bin") 408s ) 408s 408s > assert outsource(b"test2") == snapshot( 408s external("9f86d081884c*.bin") 408s ) 408s 408s test_file.py:11: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = 'external ("60303ae22b99*.bin")' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_compare_external_bytes0/test_file.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 408s ============================== 1 failed in 0.35s =============================== 408s _____________________ test_pytest_existing_external_import _____________________ 408s 408s project = .Project object at 0xf3428d20> 408s 408s def test_pytest_existing_external_import(project): 408s project.setup( 408s """\ 408s from inline_snapshot import external 408s 408s def test_a(): 408s assert outsource("test") == snapshot() 408s """ 408s ) 408s 408s result = project.run("--inline-snapshot=create") 408s 408s > assert project.source == snapshot( 408s """\ 408s from inline_snapshot import external 408s 408s def test_a(): 408s assert outsource("test") == snapshot(external("9f86d081884c*.txt")) 408s """ 408s ) 408s 408s /tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_external.py:175: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '"""\\\nfrom inline_snapshot import external\n\ndef test_a():\n assert outsource("test") == snapshot()\n"""' 408s filename = PosixPath('/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_external.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s write code: 408s # äöß 🐍 408s from inline_snapshot import snapshot 408s from inline_snapshot import outsource 408s from inline_snapshot import external 408s 408s def test_a(): 408s assert outsource("test") == snapshot() 408s 408s running: pytest --inline-snapshot=create 408s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_existing_external_import0 408s ============================= test session starts ============================== 408s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_existing_external_import0 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_file.py F [100%] 408s 408s =================================== FAILURES =================================== 408s ____________________________________ test_a ____________________________________ 408s 408s def test_a(): 408s > assert outsource("test") == snapshot() 408s 408s test_file.py:7: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_existing_external_import0/test_file.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 408s ============================== 1 failed in 0.33s =============================== 408s __________________________ test_pytest_trim_external ___________________________ 408s 408s project = .Project object at 0xf34757f8> 408s 408s def test_pytest_trim_external(project): 408s project.setup( 408s """\ 408s def test_a(): 408s assert outsource("test") == snapshot() 408s 408s # split 408s 408s assert outsource("test2") == snapshot() 408s """ 408s ) 408s 408s project.run("--inline-snapshot=create") 408s 408s > assert project.storage() == snapshot( 408s [ 408s "60303ae22b998861bce3b28f33eec1be758a213c86c93c076dbe9f558c11c752.txt", 408s "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08.txt", 408s ] 408s ) 408s 408s /tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_external.py:199: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = "'9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08-new.txt'" 408s filename = PosixPath('/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_external.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s write code: 408s # äöß 🐍 408s from inline_snapshot import snapshot 408s from inline_snapshot import outsource 408s 408s 408s def test_a(): 408s assert outsource("test") == snapshot() 408s 408s # split 408s 408s assert outsource("test2") == snapshot() 408s 408s running: pytest --inline-snapshot=create 408s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_trim_external0 408s ============================= test session starts ============================== 408s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_trim_external0 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_file.py F [100%] 408s 408s =================================== FAILURES =================================== 408s ____________________________________ test_a ____________________________________ 408s 408s def test_a(): 408s > assert outsource("test") == snapshot() 408s 408s test_file.py:7: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_trim_external0/test_file.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 408s ============================== 1 failed in 0.32s =============================== 408s ___________________________ test_pytest_new_external ___________________________ 408s 408s project = .Project object at 0xf34663c0> 408s 408s def test_pytest_new_external(project): 408s project.setup( 408s """\ 408s def test_a(): 408s assert outsource("test") == snapshot() 408s """ 408s ) 408s project.run() 408s 408s assert project.storage() == snapshot( 408s ["9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08-new.txt"] 408s ) 408s 408s project.run("--inline-snapshot=create") 408s 408s > assert project.storage() == snapshot( 408s ["9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08.txt"] 408s ) 408s 408s /tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_external.py:255: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = "'9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08-new.txt'" 408s filename = PosixPath('/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_external.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s write code: 408s # äöß 🐍 408s from inline_snapshot import snapshot 408s from inline_snapshot import outsource 408s 408s 408s def test_a(): 408s assert outsource("test") == snapshot() 408s 408s running: pytest 408s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0 408s ============================= test session starts ============================== 408s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_file.py FE [100%] 408s 408s ==================================== ERRORS ==================================== 408s _________________________ ERROR at teardown of test_a __________________________ 408s your snapshot is missing one value. 408s =================================== FAILURES =================================== 408s ____________________________________ test_a ____________________________________ 408s 408s def test_a(): 408s > assert outsource("test") == snapshot() 408s 408s test_file.py:7: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0/test_file.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 408s ERROR test_file.py::test_a - Failed: your snapshot is missing one value. 408s ========================== 1 failed, 1 error in 0.35s ========================== 408s running: pytest --inline-snapshot=create 408s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0 408s ============================= test session starts ============================== 408s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_file.py F [100%] 408s 408s =================================== FAILURES =================================== 408s ____________________________________ test_a ____________________________________ 408s 408s def test_a(): 408s > assert outsource("test") == snapshot() 408s 408s test_file.py:7: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_new_external0/test_file.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 408s ============================== 1 failed in 0.32s =============================== 408s ________________________ test_pytest_config_hash_length ________________________ 408s 408s project = .Project object at 0xf3488180> 408s 408s def test_pytest_config_hash_length(project): 408s project.setup( 408s """\ 408s def test_a(): 408s assert outsource("test") == snapshot() 408s """ 408s ) 408s project.run("--inline-snapshot=create") 408s default_result = project.source 408s 408s # default config 408s project.pyproject( 408s """ 408s [tool.inline-snapshot] 408s """ 408s ) 408s project.run("--inline-snapshot=create") 408s assert default_result == project.source 408s 408s # set hash_length 408s project.pyproject( 408s """ 408s [tool.inline-snapshot] 408s hash-length=5 408s """ 408s ) 408s project.run("--inline-snapshot=create") 408s > assert project.source == snapshot( 408s """\ 408s from inline_snapshot import external 408s 408s 408s def test_a(): 408s assert outsource("test") == snapshot(external("9f86d081884c*.txt")) 408s """ 408s ) 408s 408s /tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_external.py:287: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '"""\\\ndef test_a():\n assert outsource("test") == snapshot()\n"""' 408s filename = PosixPath('/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_external.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s write code: 408s # äöß 🐍 408s from inline_snapshot import snapshot 408s from inline_snapshot import outsource 408s 408s 408s def test_a(): 408s assert outsource("test") == snapshot() 408s 408s running: pytest --inline-snapshot=create 408s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 408s ============================= test session starts ============================== 408s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_file.py F [100%] 408s 408s =================================== FAILURES =================================== 408s ____________________________________ test_a ____________________________________ 408s 408s def test_a(): 408s > assert outsource("test") == snapshot() 408s 408s test_file.py:7: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0/test_file.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 408s ============================== 1 failed in 0.33s =============================== 408s running: pytest --inline-snapshot=create 408s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 408s ============================= test session starts ============================== 408s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 408s configfile: pyproject.toml 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_file.py F [100%] 408s 408s =================================== FAILURES =================================== 408s ____________________________________ test_a ____________________________________ 408s 408s def test_a(): 408s > assert outsource("test") == snapshot() 408s 408s test_file.py:7: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0/test_file.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 408s ============================== 1 failed in 0.32s =============================== 408s running: pytest --inline-snapshot=create 408s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 408s ============================= test session starts ============================== 408s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0 408s configfile: pyproject.toml 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_file.py F [100%] 408s 408s =================================== FAILURES =================================== 408s ____________________________________ test_a ____________________________________ 408s 408s def test_a(): 408s > assert outsource("test") == snapshot() 408s 408s test_file.py:7: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_config_hash_length0/test_file.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 408s ============================== 1 failed in 0.32s =============================== 408s _______________________________ test_no_imports ________________________________ 408s 408s project = .Project object at 0xf34ae8d0> 408s 408s def test_no_imports(project): 408s project.setup( 408s """\ 408s # no imports 408s 408s def test_something(): 408s from inline_snapshot import outsource,snapshot 408s assert outsource("test") == snapshot() 408s test_something() 408s """ 408s ) 408s 408s result = project.run("--inline-snapshot=create") 408s 408s > result.assert_outcomes(passed=1) 408s E AssertionError: assert {'errors': 1,...pped': 0, ...} == {'errors': 0,...pped': 0, ...} 408s E 408s E Omitting 4 identical items, use -vv to show 408s E Differing items: 408s E {'errors': 1} != {'errors': 0} 408s E {'passed': 0} != {'passed': 1} 408s E Use -v to get more diff 408s 408s /tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_external.py:340: AssertionError 408s ----------------------------- Captured stdout call ----------------------------- 408s write code: 408s # äöß 🐍 408s 408s 408s # no imports 408s 408s def test_something(): 408s from inline_snapshot import outsource,snapshot 408s assert outsource("test") == snapshot() 408s test_something() 408s 408s running: pytest --inline-snapshot=create 408s in: /tmp/pytest-of-ubuntu/pytest-0/test_no_imports0 408s ============================= test session starts ============================== 408s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_no_imports0 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 0 items / 1 error 408s 408s ==================================== ERRORS ==================================== 408s ________________________ ERROR collecting test_file.py _________________________ 408s test_file.py:9: in 408s test_something() 408s test_file.py:8: in test_something 408s assert outsource("test") == snapshot() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 408s runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s ERROR test_file.py - TypeError: CliRunner.__init__() got an unexpected keywor... 408s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 408s =============================== 1 error in 0.29s =============================== 408s _____________________________ test_ensure_imports ______________________________ 408s 408s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_ensure_imports0') 408s 408s def test_ensure_imports(tmp_path): 408s file = tmp_path / "file.py" 408s file.write_text( 408s """\ 408s from os import environ 408s from os import getcwd 408s """, 408s "utf-8", 408s ) 408s 408s > with apply_changes(): 408s 408s tests/test_external.py:372: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3.12/contextlib.py:144: in __exit__ 408s next(self.gen) 408s tests/utils.py:32: in apply_changes 408s recorder.fix_all() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 408s file.rewrite() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 408s new_code = self.new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 408s format_whole_file = enforce_formatting() or code == format_code( 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = 'from os import environ\nfrom os import getcwd\n' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_ensure_imports0/file.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s _______________________ test_ensure_imports_with_comment _______________________ 408s 408s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_ensure_imports_with_comme0') 408s 408s def test_ensure_imports_with_comment(tmp_path): 408s file = tmp_path / "file.py" 408s file.write_text( 408s """\ 408s from os import environ # comment 408s """, 408s "utf-8", 408s ) 408s 408s > with apply_changes(): 408s 408s tests/test_external.py:394: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3.12/contextlib.py:144: in __exit__ 408s next(self.gen) 408s tests/utils.py:32: in apply_changes 408s recorder.fix_all() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 408s file.rewrite() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 408s new_code = self.new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 408s format_whole_file = enforce_formatting() or code == format_code( 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = 'from os import environ # comment\n' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_ensure_imports_with_comme0/file.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ______________________________ test_new_externals ______________________________ 408s 408s project = .Project object at 0xf34ae0f0> 408s 408s def test_new_externals(project): 408s project.setup( 408s """ 408s 408s def test_something(): 408s outsource("blub") 408s 408s assert outsource("foo") == snapshot() 408s 408s """ 408s ) 408s 408s project.run("--inline-snapshot=create") 408s 408s > assert project.storage() == snapshot( 408s [ 408s "2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae.txt", 408s "8dc140e6fe831481a2005ae152ffe32a9974aa92a260dfbac780d6a87154bb0b-new.txt", 408s ] 408s ) 408s 408s /tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_external.py:420: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = "'2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae-new.txt'" 408s filename = PosixPath('/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_external.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s write code: 408s # äöß 🐍 408s from inline_snapshot import snapshot 408s from inline_snapshot import outsource 408s 408s 408s 408s 408s def test_something(): 408s outsource("blub") 408s 408s assert outsource("foo") == snapshot() 408s 408s 408s running: pytest --inline-snapshot=create 408s in: /tmp/pytest-of-ubuntu/pytest-0/test_new_externals0 408s ============================= test session starts ============================== 408s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_new_externals0 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_file.py F [100%] 408s 408s =================================== FAILURES =================================== 408s ________________________________ test_something ________________________________ 408s 408s def test_something(): 408s outsource("blub") 408s 408s > assert outsource("foo") == snapshot() 408s 408s test_file.py:11: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_new_externals0/test_file.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s =============================== inline snapshot ================================ 408s =========================== short test summary info ============================ 408s FAILED test_file.py::test_something - TypeError: CliRunner.__init__() got an ... 408s ============================== 1 failed in 0.32s =============================== 408s _________________________ test_black_formatting_error __________________________ 408s 408s mocker = 408s 408s def test_black_formatting_error(mocker): 408s mocker.patch.object(CliRunner, "invoke", return_value=SimpleNamespace(exit_code=1)) 408s 408s Example( 408s """\ 408s from inline_snapshot import snapshot 408s 408s def test_something(): 408s assert 1==snapshot() 408s assert 1==snapshot(2) 408s assert list(range(20)) == snapshot() 408s """ 408s > ).run_inline( 408s ["--inline-snapshot=fix,create"], 408s changed_files=snapshot( 408s { 408s "test_something.py": """\ 408s from inline_snapshot import snapshot 408s 408s def test_something(): 408s assert 1==snapshot(1) 408s assert 1==snapshot(1) 408s 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 ]) 408s """ 408s } 408s ), 408s report=snapshot( 408s """\ 408s ----------------------------------- Problems ----------------------------------- 408s black could not format your code, which might be caused by this issue: 408s https://github.com/15r10nk/inline-snapshot/issues/138 408s 408s """ 408s ), 408s ) 408s 408s tests/test_formating.py:24: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s self = 408s args = ['--inline-snapshot=fix,create'] 408s 408s def run_inline( 408s self, 408s args: list[str] = [], 408s *, 408s reported_categories: Snapshot[list[Category]] | None = None, 408s changed_files: Snapshot[dict[str, str]] | None = None, 408s report: Snapshot[str] | None = None, 408s raises: Snapshot[str] | None = None, 408s ) -> Example: 408s """Execute the example files in process and run every `test_*` 408s function. 408s 408s This is useful for fast test execution. 408s 408s Parameters: 408s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 408s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 408s changed_files: snapshot of files which are changed by this run. 408s raises: snapshot of the exception which is raised during the test execution. 408s It is required if your code raises an exception. 408s 408s Returns: 408s A new Example instance which contains the changed files. 408s """ 408s 408s parser = ArgumentParser() 408s 408s parser.add_argument( 408s "--inline-snapshot", 408s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 408s dest="inline_snapshot", 408s help="update specific snapshot values:\n" 408s "disable: disable the snapshot logic\n" 408s "short-report: show a short report\n" 408s "report: show a longer report with a diff report\n" 408s "review: allow to approve the changes interactive\n" 408s "create: creates snapshots which are currently not defined\n" 408s "update: update snapshots even if they are defined\n" 408s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 408s "fix: change snapshots which currently break your tests\n", 408s ) 408s parsed_args = parser.parse_args(args) 408s flags = (parsed_args.inline_snapshot or "").split(",") 408s 408s with TemporaryDirectory() as dir: 408s tmp_path = Path(dir) 408s 408s self._write_files(tmp_path) 408s 408s raised_exception = None 408s with snapshot_env(): 408s with ChangeRecorder().activate() as recorder: 408s _inline_snapshot._update_flags = Flags({*flags}) 408s inline_snapshot._external.storage = ( 408s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 408s ) 408s 408s try: 408s for filename in tmp_path.glob("*.py"): 408s globals: dict[str, Any] = {} 408s print("run> pytest", filename) 408s exec( 408s compile(filename.read_text("utf-8"), filename, "exec"), 408s globals, 408s ) 408s 408s # run all test_* functions 408s for k, v in globals.items(): 408s if k.startswith("test_") and callable(v): 408s v() 408s except Exception as e: 408s traceback.print_exc() 408s raised_exception = e 408s 408s finally: 408s _inline_snapshot._active = False 408s 408s changes = [] 408s for snapshot in _inline_snapshot.snapshots.values(): 408s changes += snapshot._changes() 408s 408s snapshot_flags = {change.flag for change in changes} 408s 408s apply_all( 408s [ 408s change 408s for change in changes 408s if change.flag in _inline_snapshot._update_flags.to_set() 408s ] 408s ) 408s recorder.fix_all() 408s 408s report_output = StringIO() 408s console = Console(file=report_output) 408s 408s # TODO: add all the report output here 408s report_problems(console) 408s 408s if reported_categories is not None: 408s assert sorted(snapshot_flags) == reported_categories 408s 408s if raised_exception is not None: 408s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 408s raised_exception 408s ) 408s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 408s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot 408s 408s def test_something(): 408s assert 1==snapshot() 408s assert 1==snapshot(2) 408s assert list(range(20)) == snapshot() 408s 408s 408s run> pytest /tmp/tmpsm8evh2i/test_something.py 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 408s v() 408s File "/tmp/tmpsm8evh2i/test_something.py", line 4, in test_something 408s assert 1==snapshot() 408s ^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 408s return self == other 408s ^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 408s self._changes.append(next(it)) 408s ^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 408s new_code = self.context.file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s _______________________________ test_fstring_139 _______________________________ 408s 408s def test_fstring_139(): 408s Example( 408s """ 408s from inline_snapshot import snapshot 408s snapshot(f'') 408s snapshot(rf'') 408s snapshot(Rf'') 408s snapshot(F'') 408s snapshot(rF'') 408s snapshot(RF'') 408s 408s 408s def test_a(): 408s return None 408s """ 408s > ).run_pytest(returncode=0) 408s 408s tests/test_formating.py:64: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s self = 408s args = [] 408s 408s def run_pytest( 408s self, 408s args: list[str] = [], 408s *, 408s term_columns=80, 408s env: dict[str, str] = {}, 408s changed_files: Snapshot[dict[str, str]] | None = None, 408s report: Snapshot[str] | None = None, 408s stderr: Snapshot[str] | None = None, 408s returncode: Snapshot[int] | None = None, 408s ) -> Example: 408s """Run pytest with the given args and env variables in an seperate 408s process. 408s 408s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 408s 408s Parameters: 408s args: pytest arguments like "--inline-snapshot=fix" 408s env: dict of environment variables 408s changed_files: snapshot of files which are changed by this run. 408s report: snapshot of the report at the end of the pytest run. 408s stderr: pytest stderr output 408s returncode: snapshot of the pytest returncode. 408s 408s Returns: 408s A new Example instance which contains the changed files. 408s """ 408s 408s with TemporaryDirectory() as dir: 408s tmp_path = Path(dir) 408s self._write_files(tmp_path) 408s 408s cmd = [sys.executable, "-m", "pytest", *args] 408s 408s command_env = dict(os.environ) 408s command_env["TERM"] = "unknown" 408s command_env["COLUMNS"] = str( 408s term_columns + 1 if platform.system() == "Windows" else term_columns 408s ) 408s command_env.pop("CI", None) 408s 408s command_env.update(env) 408s 408s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 408s 408s print("run>", *cmd) 408s print("stdout:") 408s print(result.stdout.decode()) 408s print("stderr:") 408s print(result.stderr.decode()) 408s 408s if returncode is not None: 408s > assert result.returncode == returncode 408s E AssertionError: assert 1 == 0 408s 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 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:297: AssertionError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s 408s from inline_snapshot import snapshot 408s snapshot(f'') 408s snapshot(rf'') 408s snapshot(Rf'') 408s snapshot(F'') 408s snapshot(rF'') 408s snapshot(RF'') 408s 408s 408s def test_a(): 408s return None 408s 408s 408s run> /usr/bin/python3.12 -m pytest 408s stdout: 408s ============================= test session starts ============================== 408s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 408s rootdir: /tmp/tmpmx37mgu0 408s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 408s collected 1 item 408s 408s test_something.py . [100%] 408s =============================== inline snapshot ================================ 408s 408s stderr: 408s Traceback (most recent call last): 408s File "", line 198, in _run_module_as_main 408s File "", line 88, in _run_code 408s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 408s raise SystemExit(pytest.console_main()) 408s ^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 408s code = main() 408s ^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 408s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 408s res = hook_impl.function(*args) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 408s return wrap_session(config, _main) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 408s config.hook.pytest_sessionfinish( 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 408s teardown.send(result) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 408s self.config.hook.pytest_terminal_summary( 408s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 408s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 408s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 408s raise exception.with_traceback(exception.__traceback__) 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 408s teardown.throw(exception) # type: ignore[union-attr] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 408s return (yield) 408s ^^^^^ 408s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 408s res = hook_impl.function(*args) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary 408s for change in snapshot._changes(): 408s ^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes 408s yield from self._value._get_changes() 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 218, in _get_changes 408s yield from handle(self._ast_node, self._old_value) 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 206, in handle 408s new_code = self._file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s _______________ test_generic[executing] [assert 4 == snapshot()] _______________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_1.py:9: in 408s assert 4 == snapshot() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 4 == snapshot() 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________ test_generic[executing] [assert 4 == snapshot({})[0]] _____________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_2.py:9: in 408s assert 4 == snapshot({})[0] 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_2.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 4 == snapshot({})[0] 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic[executing] [assert 4 == snapshot(5)] _______________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_3.py:9: in 408s assert 4 == snapshot(5) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_3.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 4 == snapshot(5) 408s ------------------------------ Captured log call ------------------------------- 408s 408s __________ test_generic[executing] [assert 4 == snapshot({0: 5})[0]] ___________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_4.py:9: in 408s assert 4 == snapshot({0: 5})[0] 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_4.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 4 == snapshot({0: 5})[0] 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____________ test_generic[executing] [assert 4 == snapshot(2+2)] ______________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_5.py:9: in 408s assert 4 == snapshot(2+2) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_5.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 4 == snapshot(2+2) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _________ test_generic[executing] [assert 4 == snapshot({0: 2+2})[0]] __________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_6.py:9: in 408s assert 4 == snapshot({0: 2+2})[0] 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_6.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 4 == snapshot({0: 2+2})[0] 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic[executing] [assert 4 <= snapshot()] _______________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 408s new_code = self._value._new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 408s return self._file._value_to_code(self._new_value) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_7.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 4 <= snapshot() 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________ test_generic[executing] [assert 4 <= snapshot({})[0]] _____________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 408s to_insert.append((key, new_value_element._new_code())) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 408s return self._file._value_to_code(self._new_value) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_8.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 4 <= snapshot({})[0] 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic[executing] [assert 4 <= snapshot(5)] _______________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_9.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 4 <= snapshot(5) 408s ------------------------------ Captured log call ------------------------------- 408s 408s __________ test_generic[executing] [assert 4 <= snapshot({0: 5})[0]] ___________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_10.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 4 <= snapshot({0: 5})[0] 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic[executing] [assert 5 <= snapshot(4)] _______________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_11.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 <= snapshot(4) 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_11.py", line 9, in 408s assert 5 <= snapshot(4) 408s ^^^^^^^^^^^^^^^^ 408s AssertionError 408s ------------------------------ Captured log call ------------------------------- 408s 408s __________ test_generic[executing] [assert 5 <= snapshot({0: 4})[0]] ___________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_12.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 <= snapshot({0: 4})[0] 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_12.py", line 9, in 408s assert 5 <= snapshot({0: 4})[0] 408s ^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____________ test_generic[executing] [assert 5 <= snapshot(3+2)] ______________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_13.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 <= snapshot(3+2) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _________ test_generic[executing] [assert 5 <= snapshot({0: 3+2})[0]] __________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_14.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 <= snapshot({0: 3+2})[0] 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic[executing] [assert 5 >= snapshot()] _______________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 408s new_code = self._value._new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 408s return self._file._value_to_code(self._new_value) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_15.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 >= snapshot() 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________ test_generic[executing] [assert 5 >= snapshot({})[0]] _____________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 408s to_insert.append((key, new_value_element._new_code())) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 408s return self._file._value_to_code(self._new_value) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_16.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 >= snapshot({})[0] 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic[executing] [assert 5 >= snapshot(4)] _______________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_17.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 >= snapshot(4) 408s ------------------------------ Captured log call ------------------------------- 408s 408s __________ test_generic[executing] [assert 5 >= snapshot({0: 4})[0]] ___________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_18.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 >= snapshot({0: 4})[0] 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic[executing] [assert 4 >= snapshot(5)] _______________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_19.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 4 >= snapshot(5) 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_19.py", line 9, in 408s assert 4 >= snapshot(5) 408s ^^^^^^^^^^^^^^^^ 408s AssertionError 408s ------------------------------ Captured log call ------------------------------- 408s 408s __________ test_generic[executing] [assert 4 >= snapshot({0: 5})[0]] ___________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_20.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 4 >= snapshot({0: 5})[0] 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_20.py", line 9, in 408s assert 4 >= snapshot({0: 5})[0] 408s ^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____________ test_generic[executing] [assert 5 >= snapshot(3+2)] ______________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_21.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 >= snapshot(3+2) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _________ test_generic[executing] [assert 5 >= snapshot({0: 3+2})[0]] __________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_22.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 >= snapshot({0: 3+2})[0] 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic[executing] [assert 5 in snapshot()] _______________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 408s new_code = self._value._new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:411: in _new_code 408s return self._file._value_to_code(self._new_value) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '[5 ]' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_23.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 in snapshot() 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________ test_generic[executing] [assert 5 in snapshot({})[0]] _____________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 408s to_insert.append((key, new_value_element._new_code())) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:411: in _new_code 408s return self._file._value_to_code(self._new_value) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '[5 ]' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_24.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 in snapshot({})[0] 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________ test_generic[executing] [assert 5 in snapshot([4, 5])] ____________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s s = source(code) 408s print("source:", code) 408s 408s if not executing_used and reported_flag == "update": 408s assert not s.flags 408s else: 408s assert list(s.flags) == [reported_flag] 408s 408s assert (reported_flag == "fix") == s.error 408s 408s for flag in all_flags: 408s if flag == reported_flag: 408s continue 408s print("use flag:", flag) 408s s2 = s.run(flag) 408s assert s2.source == s.source 408s 408s if not executing_used: 408s continue 408s 408s > s2 = s.run(reported_flag) 408s 408s tests/test_inline_snapshot.py:99: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:137: in run 408s recorder.fix_all() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 408s file.rewrite() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 408s new_code = self.new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 408s format_whole_file = enforce_formatting() or code == format_code( 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s 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])' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_29.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 in snapshot([4, 5]) 408s reported_flags: {'trim'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert 5 in snapshot([4, 5]) 408s source: assert 5 in snapshot([4, 5]) 408s use flag: fix 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 in snapshot([4, 5]) 408s reported_flags: {'trim'} 408s run: pytest --inline-snapshot=fix 408s output: 408s |assert 5 in snapshot([4, 5]) 408s use flag: create 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 in snapshot([4, 5]) 408s reported_flags: {'trim'} 408s run: pytest --inline-snapshot=create 408s output: 408s |assert 5 in snapshot([4, 5]) 408s use flag: update 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 in snapshot([4, 5]) 408s reported_flags: {'trim'} 408s run: pytest --inline-snapshot=update 408s output: 408s |assert 5 in snapshot([4, 5]) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 in snapshot([4, 5]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ________ test_generic[executing] [assert 5 in snapshot({0: [4, 5]})[0]] ________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s s = source(code) 408s print("source:", code) 408s 408s if not executing_used and reported_flag == "update": 408s assert not s.flags 408s else: 408s assert list(s.flags) == [reported_flag] 408s 408s assert (reported_flag == "fix") == s.error 408s 408s for flag in all_flags: 408s if flag == reported_flag: 408s continue 408s print("use flag:", flag) 408s s2 = s.run(flag) 408s assert s2.source == s.source 408s 408s if not executing_used: 408s continue 408s 408s > s2 = s.run(reported_flag) 408s 408s tests/test_inline_snapshot.py:99: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:137: in run 408s recorder.fix_all() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 408s file.rewrite() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 408s new_code = self.new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 408s format_whole_file = enforce_formatting() or code == format_code( 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s 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]' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_34.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 in snapshot({0: [4, 5]})[0] 408s reported_flags: {'trim'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert 5 in snapshot({0: [4, 5]})[0] 408s source: assert 5 in snapshot({0: [4, 5]})[0] 408s use flag: fix 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 in snapshot({0: [4, 5]})[0] 408s reported_flags: {'trim'} 408s run: pytest --inline-snapshot=fix 408s output: 408s |assert 5 in snapshot({0: [4, 5]})[0] 408s use flag: create 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 in snapshot({0: [4, 5]})[0] 408s reported_flags: {'trim'} 408s run: pytest --inline-snapshot=create 408s output: 408s |assert 5 in snapshot({0: [4, 5]})[0] 408s use flag: update 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 in snapshot({0: [4, 5]})[0] 408s reported_flags: {'trim'} 408s run: pytest --inline-snapshot=update 408s output: 408s |assert 5 in snapshot({0: [4, 5]})[0] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 in snapshot({0: [4, 5]})[0] 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic[executing] [assert 5 in snapshot([])] ______________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 408s new_code=[self._file._value_to_code(v) for v in new_values], 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_35.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 in snapshot([]) 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_35.py", line 9, in 408s assert 5 in snapshot([]) 408s ^^^^^^^^^^^^^^^^^ 408s AssertionError 408s ------------------------------ Captured log call ------------------------------- 408s 408s __________ test_generic[executing] [assert 5 in snapshot({0: []})[0]] __________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 408s new_code=[self._file._value_to_code(v) for v in new_values], 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_36.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 in snapshot({0: []})[0] 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_36.py", line 9, in 408s assert 5 in snapshot({0: []})[0] 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________ test_generic[executing] [assert 5 in snapshot([3+2])] _____________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_37.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 in snapshot([3+2]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ________ test_generic[executing] [assert 5 in snapshot({0: [3+2]})[0]] _________ 408s 408s source = .w at 0xf34c2f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s executing_used = True 408s 408s def test_generic(source, subtests, executing_used): 408s codes = [] 408s 408s for op in operations: 408s codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) 408s if op.svalue: 408s codes.append( 408s ( 408s f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", 408s op.flag, 408s ) 408s ) 408s else: 408s codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) 408s 408s all_flags = ["trim", "fix", "create", "update"] 408s 408s for code, reported_flag in codes: 408s with subtests.test(code): 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:79: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_executing_0/test_38.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 in snapshot({0: [3+2]})[0] 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic_multi[executing-create(==) fix(==)] _______________ 408s 408s source = .w at 0xf33e9758> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='==', svalue='5', fvalue='4', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c0/test_1.py:10: in 408s print(4 == s["k_0"]) # create -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": 5}) 408s |print(4 == s["k_0"]) # create -> 4 408s |print(4 == s["k_1"]) # fix 5 -> 4 408s _____________ test_generic_multi[executing-create(==) update(==)] ______________ 408s 408s source = .w at 0xf31c0de8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c1/test_1.py:10: in 408s print(4 == s["k_0"]) # create -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c1/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": 2+2}) 408s |print(4 == s["k_0"]) # create -> 4 408s |print(4 == s["k_1"]) # update 2+2 -> 4 408s _____________ test_generic_multi[executing-create(==) create(<=)] ______________ 408s 408s source = .w at 0xf3116d98> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='<=', svalue='', fvalue='4', flag='create')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c2/test_1.py:10: in 408s print(4 == s["k_0"]) # create -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c2/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({}) 408s |print(4 == s["k_0"]) # create -> 4 408s |print(4 <= s["k_1"]) # create -> 4 408s ______________ test_generic_multi[executing-create(==) trim(<=)] _______________ 408s 408s source = .w at 0xf3101b68> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c3/test_1.py:10: in 408s print(4 == s["k_0"]) # create -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c3/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": 5}) 408s |print(4 == s["k_0"]) # create -> 4 408s |print(4 <= s["k_1"]) # trim 5 -> 4 408s _______________ test_generic_multi[executing-create(==) fix(<=)] _______________ 408s 408s source = .w at 0xf3101e38> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c4/test_1.py:10: in 408s print(4 == s["k_0"]) # create -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c4/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": 4}) 408s |print(4 == s["k_0"]) # create -> 4 408s |print(5 <= s["k_1"]) # fix 4 -> 5 408s _____________ test_generic_multi[executing-create(==) update(<=)] ______________ 408s 408s source = .w at 0xf31013e8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c5/test_1.py:10: in 408s print(4 == s["k_0"]) # create -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c5/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": 3+2}) 408s |print(4 == s["k_0"]) # create -> 4 408s |print(5 <= s["k_1"]) # update 3+2 -> 5 408s _____________ test_generic_multi[executing-create(==) create(>=)] ______________ 408s 408s source = .w at 0xf31c0578> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c6/test_1.py:10: in 408s print(4 == s["k_0"]) # create -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c6/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({}) 408s |print(4 == s["k_0"]) # create -> 4 408s |print(5 >= s["k_1"]) # create -> 5 408s ______________ test_generic_multi[executing-create(==) trim(>=)] _______________ 408s 408s source = .w at 0xf3182758> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c7/test_1.py:10: in 408s print(4 == s["k_0"]) # create -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c7/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": 4}) 408s |print(4 == s["k_0"]) # create -> 4 408s |print(5 >= s["k_1"]) # trim 4 -> 5 408s _______________ test_generic_multi[executing-create(==) fix(>=)] _______________ 408s 408s source = .w at 0xf3182f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c8/test_1.py:10: in 408s print(4 == s["k_0"]) # create -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c8/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": 5}) 408s |print(4 == s["k_0"]) # create -> 4 408s |print(4 >= s["k_1"]) # fix 5 -> 4 408s _____________ test_generic_multi[executing-create(==) update(>=)] ______________ 408s 408s source = .w at 0xf3182488> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c9/test_1.py:10: in 408s print(4 == s["k_0"]) # create -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c9/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": 3+2}) 408s |print(4 == s["k_0"]) # create -> 4 408s |print(5 >= s["k_1"]) # update 3+2 -> 5 408s _____________ test_generic_multi[executing-create(==) create(in)] ______________ 408s 408s source = .w at 0xf3148ed8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c10/test_1.py:10: in 408s print(4 == s["k_0"]) # create -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c10/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({}) 408s |print(4 == s["k_0"]) # create -> 4 408s |print(5 in s["k_1"]) # create -> [5] 408s ______________ test_generic_multi[executing-create(==) trim(in)] _______________ 408s 408s source = .w at 0xf3101cf8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c11/test_1.py:10: in 408s print(4 == s["k_0"]) # create -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c11/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": [4, 5]}) 408s |print(4 == s["k_0"]) # create -> 4 408s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 408s _______________ test_generic_multi[executing-create(==) fix(in)] _______________ 408s 408s source = .w at 0xf3101ca8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c12/test_1.py:10: in 408s print(4 == s["k_0"]) # create -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c12/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": []}) 408s |print(4 == s["k_0"]) # create -> 4 408s |print(5 in s["k_1"]) # fix [] -> [5] 408s _____________ test_generic_multi[executing-create(==) update(in)] ______________ 408s 408s source = .w at 0xf3101ac8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c13/test_1.py:10: in 408s print(4 == s["k_0"]) # create -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c13/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": [3+2]}) 408s |print(4 == s["k_0"]) # create -> 4 408s |print(5 in s["k_1"]) # update [3+2] -> [5] 408s _______________ test_generic_multi[executing-fix(==) update(==)] _______________ 408s 408s source = .w at 0xf3247168> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f0/test_1.py:10: in 408s print(4 == s["k_0"]) # fix 5 -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5, "k_1": 2+2}) 408s |print(4 == s["k_0"]) # fix 5 -> 4 408s |print(4 == s["k_1"]) # update 2+2 -> 4 408s _______________ test_generic_multi[executing-fix(==) create(<=)] _______________ 408s 408s source = .w at 0xf3182e38> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='4', op='<=', svalue='', fvalue='4', flag='create')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f1/test_1.py:10: in 408s print(4 == s["k_0"]) # fix 5 -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f1/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5}) 408s |print(4 == s["k_0"]) # fix 5 -> 4 408s |print(4 <= s["k_1"]) # create -> 4 408s ________________ test_generic_multi[executing-fix(==) trim(<=)] ________________ 408s 408s source = .w at 0xf31c0a78> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f2/test_1.py:10: in 408s print(4 == s["k_0"]) # fix 5 -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f2/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5, "k_1": 5}) 408s |print(4 == s["k_0"]) # fix 5 -> 4 408s |print(4 <= s["k_1"]) # trim 5 -> 4 408s ________________ test_generic_multi[executing-fix(==) fix(<=)] _________________ 408s 408s source = .w at 0xf3182078> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f3/test_1.py:10: in 408s print(4 == s["k_0"]) # fix 5 -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f3/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5, "k_1": 4}) 408s |print(4 == s["k_0"]) # fix 5 -> 4 408s |print(5 <= s["k_1"]) # fix 4 -> 5 408s _______________ test_generic_multi[executing-fix(==) update(<=)] _______________ 408s 408s source = .w at 0xf30c3a28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f4/test_1.py:10: in 408s print(4 == s["k_0"]) # fix 5 -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f4/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5, "k_1": 3+2}) 408s |print(4 == s["k_0"]) # fix 5 -> 4 408s |print(5 <= s["k_1"]) # update 3+2 -> 5 408s _______________ test_generic_multi[executing-fix(==) create(>=)] _______________ 408s 408s source = .w at 0xf33e9758> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f5/test_1.py:10: in 408s print(4 == s["k_0"]) # fix 5 -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f5/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5}) 408s |print(4 == s["k_0"]) # fix 5 -> 4 408s |print(5 >= s["k_1"]) # create -> 5 408s ________________ test_generic_multi[executing-fix(==) trim(>=)] ________________ 408s 408s source = .w at 0xf30c3488> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f6/test_1.py:10: in 408s print(4 == s["k_0"]) # fix 5 -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f6/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5, "k_1": 4}) 408s |print(4 == s["k_0"]) # fix 5 -> 4 408s |print(5 >= s["k_1"]) # trim 4 -> 5 408s ________________ test_generic_multi[executing-fix(==) fix(>=)] _________________ 408s 408s source = .w at 0xf30c3ca8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f7/test_1.py:10: in 408s print(4 == s["k_0"]) # fix 5 -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f7/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5, "k_1": 5}) 408s |print(4 == s["k_0"]) # fix 5 -> 4 408s |print(4 >= s["k_1"]) # fix 5 -> 4 408s _______________ test_generic_multi[executing-fix(==) update(>=)] _______________ 408s 408s source = .w at 0xf30c3de8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f8/test_1.py:10: in 408s print(4 == s["k_0"]) # fix 5 -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f8/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5, "k_1": 3+2}) 408s |print(4 == s["k_0"]) # fix 5 -> 4 408s |print(5 >= s["k_1"]) # update 3+2 -> 5 408s _______________ test_generic_multi[executing-fix(==) create(in)] _______________ 408s 408s source = .w at 0xf33e9758> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f9/test_1.py:10: in 408s print(4 == s["k_0"]) # fix 5 -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f9/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5}) 408s |print(4 == s["k_0"]) # fix 5 -> 4 408s |print(5 in s["k_1"]) # create -> [5] 408s ________________ test_generic_multi[executing-fix(==) trim(in)] ________________ 408s 408s source = .w at 0xf320fb18> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f10/test_1.py:10: in 408s print(4 == s["k_0"]) # fix 5 -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f10/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5, "k_1": [4, 5]}) 408s |print(4 == s["k_0"]) # fix 5 -> 4 408s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 408s ________________ test_generic_multi[executing-fix(==) fix(in)] _________________ 408s 408s source = .w at 0xf30c3bb8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f11/test_1.py:10: in 408s print(4 == s["k_0"]) # fix 5 -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f11/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5, "k_1": []}) 408s |print(4 == s["k_0"]) # fix 5 -> 4 408s |print(5 in s["k_1"]) # fix [] -> [5] 408s _______________ test_generic_multi[executing-fix(==) update(in)] _______________ 408s 408s source = .w at 0xf320f438> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f12/test_1.py:10: in 408s print(4 == s["k_0"]) # fix 5 -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f12/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5, "k_1": [3+2]}) 408s |print(4 == s["k_0"]) # fix 5 -> 4 408s |print(5 in s["k_1"]) # update [3+2] -> [5] 408s _____________ test_generic_multi[executing-update(==) create(<=)] ______________ 408s 408s source = .w at 0xf320fca8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='4', op='<=', svalue='', fvalue='4', flag='create')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u0/test_1.py:10: in 408s print(4 == s["k_0"]) # update 2+2 -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 2+2}) 408s |print(4 == s["k_0"]) # update 2+2 -> 4 408s |print(4 <= s["k_1"]) # create -> 4 408s ______________ test_generic_multi[executing-update(==) trim(<=)] _______________ 408s 408s source = .w at 0xf30c3bb8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u1/test_1.py:10: in 408s print(4 == s["k_0"]) # update 2+2 -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u1/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 2+2, "k_1": 5}) 408s |print(4 == s["k_0"]) # update 2+2 -> 4 408s |print(4 <= s["k_1"]) # trim 5 -> 4 408s _______________ test_generic_multi[executing-update(==) fix(<=)] _______________ 408s 408s source = .w at 0xf320fe38> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u2/test_1.py:10: in 408s print(4 == s["k_0"]) # update 2+2 -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u2/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 2+2, "k_1": 4}) 408s |print(4 == s["k_0"]) # update 2+2 -> 4 408s |print(5 <= s["k_1"]) # fix 4 -> 5 408s _____________ test_generic_multi[executing-update(==) update(<=)] ______________ 408s 408s source = .w at 0xf3079bb8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u3/test_1.py:10: in 408s print(4 == s["k_0"]) # update 2+2 -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u3/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 2+2, "k_1": 3+2}) 408s |print(4 == s["k_0"]) # update 2+2 -> 4 408s |print(5 <= s["k_1"]) # update 3+2 -> 5 408s _____________ test_generic_multi[executing-update(==) create(>=)] ______________ 408s 408s source = .w at 0xf320f348> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u4/test_1.py:10: in 408s print(4 == s["k_0"]) # update 2+2 -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u4/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 2+2}) 408s |print(4 == s["k_0"]) # update 2+2 -> 4 408s |print(5 >= s["k_1"]) # create -> 5 408s ______________ test_generic_multi[executing-update(==) trim(>=)] _______________ 408s 408s source = .w at 0xf30796b8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u5/test_1.py:10: in 408s print(4 == s["k_0"]) # update 2+2 -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u5/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 2+2, "k_1": 4}) 408s |print(4 == s["k_0"]) # update 2+2 -> 4 408s |print(5 >= s["k_1"]) # trim 4 -> 5 408s _______________ test_generic_multi[executing-update(==) fix(>=)] _______________ 408s 408s source = .w at 0xf30799d8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u6/test_1.py:10: in 408s print(4 == s["k_0"]) # update 2+2 -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u6/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 2+2, "k_1": 5}) 408s |print(4 == s["k_0"]) # update 2+2 -> 4 408s |print(4 >= s["k_1"]) # fix 5 -> 4 408s _____________ test_generic_multi[executing-update(==) update(>=)] ______________ 408s 408s source = .w at 0xf31c0cf8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u7/test_1.py:10: in 408s print(4 == s["k_0"]) # update 2+2 -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u7/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 2+2, "k_1": 3+2}) 408s |print(4 == s["k_0"]) # update 2+2 -> 4 408s |print(5 >= s["k_1"]) # update 3+2 -> 5 408s _____________ test_generic_multi[executing-update(==) create(in)] ______________ 408s 408s source = .w at 0xf2fc1938> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u8/test_1.py:10: in 408s print(4 == s["k_0"]) # update 2+2 -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u8/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 2+2}) 408s |print(4 == s["k_0"]) # update 2+2 -> 4 408s |print(5 in s["k_1"]) # create -> [5] 408s ______________ test_generic_multi[executing-update(==) trim(in)] _______________ 408s 408s source = .w at 0xf2fc1de8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u9/test_1.py:10: in 408s print(4 == s["k_0"]) # update 2+2 -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u9/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 2+2, "k_1": [4, 5]}) 408s |print(4 == s["k_0"]) # update 2+2 -> 4 408s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 408s _______________ test_generic_multi[executing-update(==) fix(in)] _______________ 408s 408s source = .w at 0xf30793e8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u10/test_1.py:10: in 408s print(4 == s["k_0"]) # update 2+2 -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u10/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 2+2, "k_1": []}) 408s |print(4 == s["k_0"]) # update 2+2 -> 4 408s |print(5 in s["k_1"]) # fix [] -> [5] 408s _____________ test_generic_multi[executing-update(==) update(in)] ______________ 408s 408s source = .w at 0xf2fc18e8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u11/test_1.py:10: in 408s print(4 == s["k_0"]) # update 2+2 -> 4 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u11/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 2+2, "k_1": [3+2]}) 408s |print(4 == s["k_0"]) # update 2+2 -> 4 408s |print(5 in s["k_1"]) # update [3+2] -> [5] 408s ______________ test_generic_multi[executing-create(<=) trim(<=)] _______________ 408s 408s source = .w at 0xf2fc1bb8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c14/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": 5}) 408s |print(4 <= s["k_0"]) # create -> 4 408s |print(4 <= s["k_1"]) # trim 5 -> 4 408s True 408s True 408s _______________ test_generic_multi[executing-create(<=) fix(<=)] _______________ 408s 408s source = .w at 0xf3079f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c15/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": 4}) 408s |print(4 <= s["k_0"]) # create -> 4 408s |print(5 <= s["k_1"]) # fix 4 -> 5 408s True 408s False 408s _____________ test_generic_multi[executing-create(<=) update(<=)] ______________ 408s 408s source = .w at 0xf2fc14d8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c16/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": 3+2}) 408s |print(4 <= s["k_0"]) # create -> 4 408s |print(5 <= s["k_1"]) # update 3+2 -> 5 408s True 408s True 408s _____________ test_generic_multi[executing-create(<=) create(>=)] ______________ 408s 408s source = .w at 0xf3028e38> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 408s to_insert.append((key, new_value_element._new_code())) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 408s return self._file._value_to_code(self._new_value) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c17/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({}) 408s |print(4 <= s["k_0"]) # create -> 4 408s |print(5 >= s["k_1"]) # create -> 5 408s True 408s True 408s ______________ test_generic_multi[executing-create(<=) trim(>=)] _______________ 408s 408s source = .w at 0xf2fc14d8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c18/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": 4}) 408s |print(4 <= s["k_0"]) # create -> 4 408s |print(5 >= s["k_1"]) # trim 4 -> 5 408s True 408s True 408s _______________ test_generic_multi[executing-create(<=) fix(>=)] _______________ 408s 408s source = .w at 0xf3028348> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c19/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": 5}) 408s |print(4 <= s["k_0"]) # create -> 4 408s |print(4 >= s["k_1"]) # fix 5 -> 4 408s True 408s False 408s _____________ test_generic_multi[executing-create(<=) update(>=)] ______________ 408s 408s source = .w at 0xf3028208> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c20/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": 3+2}) 408s |print(4 <= s["k_0"]) # create -> 4 408s |print(5 >= s["k_1"]) # update 3+2 -> 5 408s True 408s True 408s _____________ test_generic_multi[executing-create(<=) create(in)] ______________ 408s 408s source = .w at 0xf3028e88> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 408s to_insert.append((key, new_value_element._new_code())) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 408s return self._file._value_to_code(self._new_value) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c21/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({}) 408s |print(4 <= s["k_0"]) # create -> 4 408s |print(5 in s["k_1"]) # create -> [5] 408s True 408s True 408s ______________ test_generic_multi[executing-create(<=) trim(in)] _______________ 408s 408s source = .w at 0xf3079a28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 408s to_insert.append((key, new_value_element._new_code())) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 408s return self._file._value_to_code(self._new_value) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c22/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": [4, 5]}) 408s |print(4 <= s["k_0"]) # create -> 4 408s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 408s True 408s True 408s _______________ test_generic_multi[executing-create(<=) fix(in)] _______________ 408s 408s source = .w at 0xf3028208> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 408s new_code=[self._file._value_to_code(v) for v in new_values], 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c23/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": []}) 408s |print(4 <= s["k_0"]) # create -> 4 408s |print(5 in s["k_1"]) # fix [] -> [5] 408s True 408s False 408s _____________ test_generic_multi[executing-create(<=) update(in)] ______________ 408s 408s source = .w at 0xf37b27f8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c24/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": [3+2]}) 408s |print(4 <= s["k_0"]) # create -> 4 408s |print(5 in s["k_1"]) # update [3+2] -> [5] 408s True 408s True 408s ________________ test_generic_multi[executing-trim(<=) fix(<=)] ________________ 408s 408s source = .w at 0xf31c0d48> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5, "k_1": 4}) 408s |print(4 <= s["k_0"]) # trim 5 -> 4 408s |print(5 <= s["k_1"]) # fix 4 -> 5 408s True 408s False 408s ______________ test_generic_multi[executing-trim(<=) update(<=)] _______________ 408s 408s source = .w at 0xf2fc1f78> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t1/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5, "k_1": 3+2}) 408s |print(4 <= s["k_0"]) # trim 5 -> 4 408s |print(5 <= s["k_1"]) # update 3+2 -> 5 408s True 408s True 408s ______________ test_generic_multi[executing-trim(<=) create(>=)] _______________ 408s 408s source = .w at 0xf3116528> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t2/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5}) 408s |print(4 <= s["k_0"]) # trim 5 -> 4 408s |print(5 >= s["k_1"]) # create -> 5 408s True 408s True 408s _______________ test_generic_multi[executing-trim(<=) trim(>=)] ________________ 408s 408s source = .w at 0xf31c0208> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t3/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5, "k_1": 4}) 408s |print(4 <= s["k_0"]) # trim 5 -> 4 408s |print(5 >= s["k_1"]) # trim 4 -> 5 408s True 408s True 408s ________________ test_generic_multi[executing-trim(<=) fix(>=)] ________________ 408s 408s source = .w at 0xf3079028> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t4/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5, "k_1": 5}) 408s |print(4 <= s["k_0"]) # trim 5 -> 4 408s |print(4 >= s["k_1"]) # fix 5 -> 4 408s True 408s False 408s ______________ test_generic_multi[executing-trim(<=) update(>=)] _______________ 408s 408s source = .w at 0xf3182668> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t5/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5, "k_1": 3+2}) 408s |print(4 <= s["k_0"]) # trim 5 -> 4 408s |print(5 >= s["k_1"]) # update 3+2 -> 5 408s True 408s True 408s ______________ test_generic_multi[executing-trim(<=) create(in)] _______________ 408s 408s source = .w at 0xf31825c8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t6/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5}) 408s |print(4 <= s["k_0"]) # trim 5 -> 4 408s |print(5 in s["k_1"]) # create -> [5] 408s True 408s True 408s _______________ test_generic_multi[executing-trim(<=) trim(in)] ________________ 408s 408s source = .w at 0xf30c3b68> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t7/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5, "k_1": [4, 5]}) 408s |print(4 <= s["k_0"]) # trim 5 -> 4 408s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 408s True 408s True 408s ________________ test_generic_multi[executing-trim(<=) fix(in)] ________________ 408s 408s source = .w at 0xf2fdc9d8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t8/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5, "k_1": []}) 408s |print(4 <= s["k_0"]) # trim 5 -> 4 408s |print(5 in s["k_1"]) # fix [] -> [5] 408s True 408s False 408s ______________ test_generic_multi[executing-trim(<=) update(in)] _______________ 408s 408s source = .w at 0xf31c0208> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t9/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5, "k_1": [3+2]}) 408s |print(4 <= s["k_0"]) # trim 5 -> 4 408s |print(5 in s["k_1"]) # update [3+2] -> [5] 408s True 408s True 408s _______________ test_generic_multi[executing-fix(<=) update(<=)] _______________ 408s 408s source = .w at 0xf2fdc078> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f13/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 4, "k_1": 3+2}) 408s |print(5 <= s["k_0"]) # fix 4 -> 5 408s |print(5 <= s["k_1"]) # update 3+2 -> 5 408s False 408s True 408s _______________ test_generic_multi[executing-fix(<=) create(>=)] _______________ 408s 408s source = .w at 0xf2fdcbb8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f14/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 4}) 408s |print(5 <= s["k_0"]) # fix 4 -> 5 408s |print(5 >= s["k_1"]) # create -> 5 408s False 408s True 408s ________________ test_generic_multi[executing-fix(<=) trim(>=)] ________________ 408s 408s source = .w at 0xf3079028> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f15/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 4, "k_1": 4}) 408s |print(5 <= s["k_0"]) # fix 4 -> 5 408s |print(5 >= s["k_1"]) # trim 4 -> 5 408s False 408s True 408s ________________ test_generic_multi[executing-fix(<=) fix(>=)] _________________ 408s 408s source = .w at 0xf30c3ca8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f16/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 4, "k_1": 5}) 408s |print(5 <= s["k_0"]) # fix 4 -> 5 408s |print(4 >= s["k_1"]) # fix 5 -> 4 408s False 408s False 408s _______________ test_generic_multi[executing-fix(<=) update(>=)] _______________ 408s 408s source = .w at 0xf2fdebb8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f17/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 4, "k_1": 3+2}) 408s |print(5 <= s["k_0"]) # fix 4 -> 5 408s |print(5 >= s["k_1"]) # update 3+2 -> 5 408s False 408s True 408s _______________ test_generic_multi[executing-fix(<=) create(in)] _______________ 408s 408s source = .w at 0xf31c0208> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f18/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 4}) 408s |print(5 <= s["k_0"]) # fix 4 -> 5 408s |print(5 in s["k_1"]) # create -> [5] 408s False 408s True 408s ________________ test_generic_multi[executing-fix(<=) trim(in)] ________________ 408s 408s source = .w at 0xf2fdeac8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f19/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 4, "k_1": [4, 5]}) 408s |print(5 <= s["k_0"]) # fix 4 -> 5 408s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 408s False 408s True 408s ________________ test_generic_multi[executing-fix(<=) fix(in)] _________________ 408s 408s source = .w at 0xf2fde9d8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f20/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 4, "k_1": []}) 408s |print(5 <= s["k_0"]) # fix 4 -> 5 408s |print(5 in s["k_1"]) # fix [] -> [5] 408s False 408s False 408s _______________ test_generic_multi[executing-fix(<=) update(in)] _______________ 408s 408s source = .w at 0xf2fdef28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f21/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 4, "k_1": [3+2]}) 408s |print(5 <= s["k_0"]) # fix 4 -> 5 408s |print(5 in s["k_1"]) # update [3+2] -> [5] 408s False 408s True 408s _____________ test_generic_multi[executing-update(<=) create(>=)] ______________ 408s 408s source = .w at 0xf3079028> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u12/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 3+2}) 408s |print(5 <= s["k_0"]) # update 3+2 -> 5 408s |print(5 >= s["k_1"]) # create -> 5 408s True 408s True 408s ______________ test_generic_multi[executing-update(<=) trim(>=)] _______________ 408s 408s source = .w at 0xf2f39b18> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u13/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 3+2, "k_1": 4}) 408s |print(5 <= s["k_0"]) # update 3+2 -> 5 408s |print(5 >= s["k_1"]) # trim 4 -> 5 408s True 408s True 408s _______________ test_generic_multi[executing-update(<=) fix(>=)] _______________ 408s 408s source = .w at 0xf2fdce38> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u14/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 3+2, "k_1": 5}) 408s |print(5 <= s["k_0"]) # update 3+2 -> 5 408s |print(4 >= s["k_1"]) # fix 5 -> 4 408s True 408s False 408s _____________ test_generic_multi[executing-update(<=) update(>=)] ______________ 408s 408s source = .w at 0xf2f395c8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==)]>>) 408s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u15/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 3+2, "k_1": 3+2}) 408s |print(5 <= s["k_0"]) # update 3+2 -> 5 408s |print(5 >= s["k_1"]) # update 3+2 -> 5 408s True 408s True 408s _____________ test_generic_multi[executing-update(<=) create(in)] ______________ 408s 408s source = .w at 0xf2f39488> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u16/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 3+2}) 408s |print(5 <= s["k_0"]) # update 3+2 -> 5 408s |print(5 in s["k_1"]) # create -> [5] 408s True 408s True 408s ______________ test_generic_multi[executing-update(<=) trim(in)] _______________ 408s 408s source = .w at 0xf2f396b8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u17/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 3+2, "k_1": [4, 5]}) 408s |print(5 <= s["k_0"]) # update 3+2 -> 5 408s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 408s True 408s True 408s _______________ test_generic_multi[executing-update(<=) fix(in)] _______________ 408s 408s source = .w at 0xf2f39a78> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u18/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 3+2, "k_1": []}) 408s |print(5 <= s["k_0"]) # update 3+2 -> 5 408s |print(5 in s["k_1"]) # fix [] -> [5] 408s True 408s False 408s _____________ test_generic_multi[executing-update(<=) update(in)] ______________ 408s 408s source = .w at 0xf2ebf528> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u19/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 3+2, "k_1": [3+2]}) 408s |print(5 <= s["k_0"]) # update 3+2 -> 5 408s |print(5 in s["k_1"]) # update [3+2] -> [5] 408s True 408s True 408s ______________ test_generic_multi[executing-create(>=) trim(>=)] _______________ 408s 408s source = .w at 0xf2f39ca8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==) trim(>=)]>>) 408s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c25/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": 4}) 408s |print(5 >= s["k_0"]) # create -> 5 408s |print(5 >= s["k_1"]) # trim 4 -> 5 408s True 408s True 408s _______________ test_generic_multi[executing-create(>=) fix(>=)] _______________ 408s 408s source = .w at 0xf2f39bb8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==) fix(>=)]>>) 408s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c26/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": 5}) 408s |print(5 >= s["k_0"]) # create -> 5 408s |print(4 >= s["k_1"]) # fix 5 -> 4 408s True 408s False 408s _____________ test_generic_multi[executing-create(>=) update(>=)] ______________ 408s 408s source = .w at 0xf2fdeb68> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==) update(>=)]>>) 408s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c27/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": 3+2}) 408s |print(5 >= s["k_0"]) # create -> 5 408s |print(5 >= s["k_1"]) # update 3+2 -> 5 408s True 408s True 408s _____________ test_generic_multi[executing-create(>=) create(in)] ______________ 408s 408s source = .w at 0xf2fde578> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==) create(in)]>>) 408s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 408s to_insert.append((key, new_value_element._new_code())) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 408s return self._file._value_to_code(self._new_value) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c28/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({}) 408s |print(5 >= s["k_0"]) # create -> 5 408s |print(5 in s["k_1"]) # create -> [5] 408s True 408s True 408s ______________ test_generic_multi[executing-create(>=) trim(in)] _______________ 408s 408s source = .w at 0xf2f39b18> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==) trim(in)]>>) 408s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 408s to_insert.append((key, new_value_element._new_code())) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 408s return self._file._value_to_code(self._new_value) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c29/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": [4, 5]}) 408s |print(5 >= s["k_0"]) # create -> 5 408s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 408s True 408s True 408s _______________ test_generic_multi[executing-create(>=) fix(in)] _______________ 408s 408s source = .w at 0xf37b27f8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==) fix(in)]>>) 408s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 408s new_code=[self._file._value_to_code(v) for v in new_values], 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c30/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": []}) 408s |print(5 >= s["k_0"]) # create -> 5 408s |print(5 in s["k_1"]) # fix [] -> [5] 408s True 408s False 408s _____________ test_generic_multi[executing-create(>=) update(in)] ______________ 408s 408s source = .w at 0xf30c3938> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==) update(in)]>>) 408s ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c31/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": [3+2]}) 408s |print(5 >= s["k_0"]) # create -> 5 408s |print(5 in s["k_1"]) # update [3+2] -> [5] 408s True 408s True 408s ________________ test_generic_multi[executing-trim(>=) fix(>=)] ________________ 408s 408s source = .w at 0xf3028f28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==) fix(>=)]>>) 408s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t10/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 4, "k_1": 5}) 408s |print(5 >= s["k_0"]) # trim 4 -> 5 408s |print(4 >= s["k_1"]) # fix 5 -> 4 408s True 408s False 408s ______________ test_generic_multi[executing-trim(>=) update(>=)] _______________ 408s 408s source = .w at 0xf320fca8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==) update(>=)]>>) 408s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t11/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 4, "k_1": 3+2}) 408s |print(5 >= s["k_0"]) # trim 4 -> 5 408s |print(5 >= s["k_1"]) # update 3+2 -> 5 408s True 408s True 408s ______________ test_generic_multi[executing-trim(>=) create(in)] _______________ 408s 408s source = .w at 0xf3489a28> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==) create(in)]>>) 408s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t12/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 4}) 408s |print(5 >= s["k_0"]) # trim 4 -> 5 408s |print(5 in s["k_1"]) # create -> [5] 408s True 408s True 408s _______________ test_generic_multi[executing-trim(>=) trim(in)] ________________ 408s 408s source = .w at 0xf2fc1ca8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==) trim(in)]>>) 408s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t13/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 4, "k_1": [4, 5]}) 408s |print(5 >= s["k_0"]) # trim 4 -> 5 408s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 408s True 408s True 408s ________________ test_generic_multi[executing-trim(>=) fix(in)] ________________ 408s 408s source = .w at 0xf3182d48> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==) fix(in)]>>) 408s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t14/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 4, "k_1": []}) 408s |print(5 >= s["k_0"]) # trim 4 -> 5 408s |print(5 in s["k_1"]) # fix [] -> [5] 408s True 408s False 408s ______________ test_generic_multi[executing-trim(>=) update(in)] _______________ 408s 408s source = .w at 0xf3028de8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==) update(in)]>>) 408s ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t15/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 4, "k_1": [3+2]}) 408s |print(5 >= s["k_0"]) # trim 4 -> 5 408s |print(5 in s["k_1"]) # update [3+2] -> [5] 408s True 408s True 408s _______________ test_generic_multi[executing-fix(>=) update(>=)] _______________ 408s 408s source = .w at 0xf34c22a8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==) update(>=)]>>) 408s ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f22/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5, "k_1": 3+2}) 408s |print(4 >= s["k_0"]) # fix 5 -> 4 408s |print(5 >= s["k_1"]) # update 3+2 -> 5 408s False 408s True 408s _______________ test_generic_multi[executing-fix(>=) create(in)] _______________ 408s 408s source = .w at 0xf2ebf618> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==) create(in)]>>) 408s ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f23/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5}) 408s |print(4 >= s["k_0"]) # fix 5 -> 4 408s |print(5 in s["k_1"]) # create -> [5] 408s False 408s True 408s ________________ test_generic_multi[executing-fix(>=) trim(in)] ________________ 408s 408s source = .w at 0xf2ebf708> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==) trim(in)]>>) 408s ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f24/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5, "k_1": [4, 5]}) 408s |print(4 >= s["k_0"]) # fix 5 -> 4 408s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 408s False 408s True 408s ________________ test_generic_multi[executing-fix(>=) fix(in)] _________________ 408s 408s source = .w at 0xf2ebf258> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==) fix(in)]>>) 408s ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f25/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5, "k_1": []}) 408s |print(4 >= s["k_0"]) # fix 5 -> 4 408s |print(5 in s["k_1"]) # fix [] -> [5] 408s False 408s False 408s _______________ test_generic_multi[executing-fix(>=) update(in)] _______________ 408s 408s source = .w at 0xf2f50a78> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==) update(in)]>>) 408s ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f26/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 5, "k_1": [3+2]}) 408s |print(4 >= s["k_0"]) # fix 5 -> 4 408s |print(5 in s["k_1"]) # update [3+2] -> [5] 408s False 408s True 408s _____________ test_generic_multi[executing-update(>=) create(in)] ______________ 408s 408s source = .w at 0xf3028de8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==) create(in)]>>) 408s ops = (operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u20/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 3+2}) 408s |print(5 >= s["k_0"]) # update 3+2 -> 5 408s |print(5 in s["k_1"]) # create -> [5] 408s True 408s True 408s ______________ test_generic_multi[executing-update(>=) trim(in)] _______________ 408s 408s source = .w at 0xf2ebf078> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==) trim(in)]>>) 408s ops = (operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u21/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 3+2, "k_1": [4, 5]}) 408s |print(5 >= s["k_0"]) # update 3+2 -> 5 408s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 408s True 408s True 408s _______________ test_generic_multi[executing-update(>=) fix(in)] _______________ 408s 408s source = .w at 0xf2f50ed8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==) fix(in)]>>) 408s ops = (operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u22/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 3+2, "k_1": []}) 408s |print(5 >= s["k_0"]) # update 3+2 -> 5 408s |print(5 in s["k_1"]) # fix [] -> [5] 408s True 408s False 408s _____________ test_generic_multi[executing-update(>=) update(in)] ______________ 408s 408s source = .w at 0xf2f507a8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request==) update(in)]>>) 408s ops = (operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_u23/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": 3+2, "k_1": [3+2]}) 408s |print(5 >= s["k_0"]) # update 3+2 -> 5 408s |print(5 in s["k_1"]) # update [3+2] -> [5] 408s True 408s True 408s ______________ test_generic_multi[executing-create(in) trim(in)] _______________ 408s 408s source = .w at 0xf2f509d8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='5', op='in', svalue='', fvalue='[5]', flag='create'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes 408s to_insert.append((key, new_value_element._new_code())) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:411: in _new_code 408s return self._file._value_to_code(self._new_value) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '[5 ]' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c32/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": [4, 5]}) 408s |print(5 in s["k_0"]) # create -> [5] 408s |print(5 in s["k_1"]) # trim [4, 5] -> [5] 408s True 408s True 408s _______________ test_generic_multi[executing-create(in) fix(in)] _______________ 408s 408s source = .w at 0xf2ed49d8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='5', op='in', svalue='', fvalue='[5]', flag='create'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 408s new_code=[self._file._value_to_code(v) for v in new_values], 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c33/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": []}) 408s |print(5 in s["k_0"]) # create -> [5] 408s |print(5 in s["k_1"]) # fix [] -> [5] 408s True 408s False 408s _____________ test_generic_multi[executing-create(in) update(in)] ______________ 408s 408s source = .w at 0xf2f50e88> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='5', op='in', svalue='', fvalue='[5]', flag='create'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_c34/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_1": [3+2]}) 408s |print(5 in s["k_0"]) # create -> [5] 408s |print(5 in s["k_1"]) # update [3+2] -> [5] 408s True 408s True 408s ________________ test_generic_multi[executing-trim(in) fix(in)] ________________ 408s 408s source = .w at 0xf2ed41b8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 408s new_code=[self._file._value_to_code(v) for v in new_values], 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t16/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": [4, 5], "k_1": []}) 408s |print(5 in s["k_0"]) # trim [4, 5] -> [5] 408s |print(5 in s["k_1"]) # fix [] -> [5] 408s True 408s False 408s ______________ test_generic_multi[executing-trim(in) update(in)] _______________ 408s 408s source = .w at 0xf2ed48e8> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s 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')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes 408s new_code = self._file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_t17/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": [4, 5], "k_1": [3+2]}) 408s |print(5 in s["k_0"]) # trim [4, 5] -> [5] 408s |print(5 in s["k_1"]) # update [3+2] -> [5] 408s True 408s True 408s _______________ test_generic_multi[executing-fix(in) update(in)] _______________ 408s 408s source = .w at 0xf2ed4c58> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx=>, request=>) 408s ops = (operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) 408s executing_used = True 408s 408s @pytest.mark.parametrize( 408s "ops", 408s [ 408s pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) 408s for ops in itertools.combinations(operations, 2) 408s ], 408s ) 408s def test_generic_multi(source, subtests, ops, executing_used): 408s 408s def gen_code(ops, fixed, old_keys): 408s keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] 408s new_keys = [] 408s 408s args = [] 408s print(keys) 408s for k in keys: 408s op = ops[k] 408s value = op.fvalue if op.flag in fixed else op.svalue 408s if value: 408s args.append(f'"k_{k}": {value}') 408s new_keys.append(k) 408s args = ", ".join(args) 408s 408s code = "s = snapshot({" + args + "})\n" 408s 408s for k, op in enumerate(ops): 408s code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' 408s 408s return code, new_keys 408s 408s all_flags = {op.flag for op in ops} 408s 408s keys = [] 408s code, keys = gen_code(ops, {}, keys) 408s > s = source(code) 408s 408s tests/test_inline_snapshot.py:141: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 408s yield from self._value._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes 408s yield from self._new_value[key]._get_changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes 408s new_code=[self._file._value_to_code(v) for v in new_values], 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic_multi_executing_f27/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s [0, 1] 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |s = snapshot({"k_0": [], "k_1": [3+2]}) 408s |print(5 in s["k_0"]) # fix [] -> [5] 408s |print(5 in s["k_1"]) # update [3+2] -> [5] 408s False 408s True 408s _____________________________ test_mutable_values ______________________________ 408s 408s check_update = .w at 0xf320f9d8> 408s 408s def test_mutable_values(check_update): 408s assert ( 408s > check_update( 408s """ 408s l=[1,2] 408s assert l==snapshot() 408s l.append(3) 408s assert l==snapshot() 408s """, 408s flags="create", 408s number=2, 408s ) 408s == snapshot( 408s """\ 408s 408s l=[1,2] 408s assert l==snapshot([1, 2]) 408s l.append(3) 408s assert l==snapshot([1, 2, 3]) 408s """ 408s ) 408s ) 408s 408s tests/test_inline_snapshot.py:168: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:49: in w 408s s = source(source_code) 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_mutable_values0/test_1.py:11: in 408s assert l==snapshot() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_mutable_values0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s | 408s |l=[1,2] 408s |assert l==snapshot() 408s |l.append(3) 408s |assert l==snapshot() 408s _______________________________ test_comparison ________________________________ 408s 408s check_update = .w at 0xf2f50848> 408s 408s def test_comparison(check_update): 408s > assert check_update("assert 5==snapshot()", flags="create") == snapshot( 408s "assert 5==snapshot(5)" 408s ) 408s 408s tests/test_inline_snapshot.py:257: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:49: in w 408s s = source(source_code) 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_comparison0/test_1.py:9: in 408s assert 5==snapshot() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_comparison0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5==snapshot() 408s ___________________________________ test_ge ____________________________________ 408s 408s check_update = .w at 0xf2ed41b8> 408s 408s def test_ge(check_update): 408s > assert check_update("assert 5<=snapshot()", flags="create") == snapshot( 408s "assert 5<=snapshot(5)" 408s ) 408s 408s tests/test_inline_snapshot.py:309: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:49: in w 408s s = source(source_code) 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 408s new_code = self._value._new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 408s return self._file._value_to_code(self._new_value) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_ge0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5<=snapshot() 408s ___________________________________ test_le ____________________________________ 408s 408s check_update = .w at 0xf2fdcbb8> 408s 408s def test_le(check_update): 408s > assert check_update("assert 5>=snapshot()", flags="create") == snapshot( 408s "assert 5>=snapshot(5)" 408s ) 408s 408s tests/test_inline_snapshot.py:381: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:49: in w 408s s = source(source_code) 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 408s new_code = self._value._new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code 408s return self._file._value_to_code(self._new_value) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '5 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_le0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5>=snapshot() 408s ________________________________ test_contains _________________________________ 408s 408s check_update = .w at 0xf2ed49d8> 408s 408s def test_contains(check_update): 408s > assert check_update("assert 5 in snapshot()", flags="create") == snapshot( 408s "assert 5 in snapshot([5])" 408s ) 408s 408s tests/test_inline_snapshot.py:449: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:49: in w 408s s = source(source_code) 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:125: in run 408s changes += snapshot._changes() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes 408s new_code = self._value._new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:411: in _new_code 408s return self._file._value_to_code(self._new_value) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '[5 ]' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_contains0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 in snapshot() 408s _________________________________ test_getitem _________________________________ 408s 408s check_update = .w at 0xf2fdeb68> 408s 408s def test_getitem(check_update): 408s > assert check_update('assert 5 == snapshot()["test"]', flags="create") == snapshot( 408s 'assert 5 == snapshot({"test": 5})["test"]' 408s ) 408s 408s tests/test_inline_snapshot.py:492: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:49: in w 408s s = source(source_code) 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_getitem0/test_1.py:9: in 408s assert 5 == snapshot()["test"] 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_getitem0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 5 == snapshot()["test"] 408s _________________________________ test_assert __________________________________ 408s 408s check_update = .w at 0xf2f502f8> 408s 408s def test_assert(check_update): 408s > assert check_update("assert 2 == snapshot(5)", reported_flags="fix") 408s 408s tests/test_inline_snapshot.py:574: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:49: in w 408s s = source(source_code) 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_assert0/test_1.py:9: in 408s assert 2 == snapshot(5) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '2 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_assert0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert 2 == snapshot(5) 408s _______________________________ test_format_file _______________________________ 408s 408s check_update = .w at 0xf2ed7118> 408s 408s def test_format_file(check_update): 408s > assert check_update( 408s 'assert ["aaaaaaaaaaaaaaaaa"] * 5 == snapshot()\n', flags="create" 408s ) == snapshot( 408s """\ 408s assert ["aaaaaaaaaaaaaaaaa"] * 5 == snapshot([ 408s "aaaaaaaaaaaaaaaaa", 408s "aaaaaaaaaaaaaaaaa", 408s "aaaaaaaaaaaaaaaaa", 408s "aaaaaaaaaaaaaaaaa", 408s "aaaaaaaaaaaaaaaaa", 408s ]) 408s """ 408s ) 408s 408s tests/test_inline_snapshot.py:588: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:49: in w 408s s = source(source_code) 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_format_file0/test_1.py:9: in 408s assert ["aaaaaaaaaaaaaaaaa"] * 5 == snapshot() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_format_file0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert ["aaaaaaaaaaaaaaaaa"] * 5 == snapshot() 408s ______________________________ test_format_value _______________________________ 408s 408s check_update = .w at 0xf2ebf528> 408s 408s def test_format_value(check_update): 408s > assert check_update( 408s 'assert ["aaaaaaaaaaaaaaaaa"] * 5== snapshot()\n', flags="create" 408s ) == snapshot( 408s """\ 408s assert ["aaaaaaaaaaaaaaaaa"] * 5== snapshot([ 408s "aaaaaaaaaaaaaaaaa", 408s "aaaaaaaaaaaaaaaaa", 408s "aaaaaaaaaaaaaaaaa", 408s "aaaaaaaaaaaaaaaaa", 408s "aaaaaaaaaaaaaaaaa", 408s ]) 408s """ 408s ) 408s 408s tests/test_inline_snapshot.py:604: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:49: in w 408s s = source(source_code) 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_format_value0/test_1.py:9: in 408s assert ["aaaaaaaaaaaaaaaaa"] * 5== snapshot() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_format_value0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert ["aaaaaaaaaaaaaaaaa"] * 5== snapshot() 408s _______________________________ test_type_error ________________________________ 408s 408s check_update = .w at 0xf2ed7168> 408s 408s def test_type_error(check_update): 408s tests = ["5 == s", "5 <= s", "5 >= s", "5 in s", "5 == s[0]"] 408s 408s for test1, test2 in itertools.product(tests, tests): 408s with pytest.raises(TypeError) if test1 != test2 else nullcontext() as error: 408s > check_update( 408s f""" 408s s = snapshot() 408s assert {test1} 408s assert {test2} 408s """, 408s reported_flags="create", 408s ) 408s 408s tests/test_inline_snapshot.py:631: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:49: in w 408s s = source(source_code) 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_type_error0/test_1.py:11: in 408s assert 5 == s 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_type_error0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s | 408s |s = snapshot() 408s |assert 5 == s 408s |assert 5 == s 408s _________________________ test_different_snapshot_name _________________________ 408s 408s check_update = .w at 0xf2ed70c8> 408s 408s def test_different_snapshot_name(check_update): 408s 408s assert ( 408s > check_update( 408s """\ 408s from inline_snapshot import snapshot as s 408s assert 4==s() 408s 408s """, 408s flags="create", 408s ) 408s == snapshot( 408s """\ 408s from inline_snapshot import snapshot as s 408s assert 4==s(4) 408s 408s """ 408s ) 408s ) 408s 408s tests/test_inline_snapshot.py:695: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:49: in w 408s s = source(source_code) 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_different_snapshot_name0/test_1.py:10: in 408s assert 4==s() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_different_snapshot_name0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |from inline_snapshot import snapshot as s 408s |assert 4==s() 408s | 408s _______________________ test_quoting_change_is_no_update _______________________ 408s 408s source = .w at 0xf2ebfb18> 408s 408s def test_quoting_change_is_no_update(source): 408s 408s > s = source( 408s """\ 408s from inline_snapshot import external,snapshot 408s 408s class X: 408s def __init__(self,a): 408s self.a=a 408s pass 408s 408s def __repr__(self): 408s return f'X("{self.a}")' 408s 408s def __eq__(self,other): 408s if not hasattr(other,"a"): 408s return NotImplemented 408s return other.a==self.a 408s 408s assert X("a") == snapshot() 408s """ 408s ) 408s 408s tests/test_inline_snapshot.py:731: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_quoting_change_is_no_upda0/test_1.py:24: in 408s assert X("a") == snapshot() 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_quoting_change_is_no_upda0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |from inline_snapshot import external,snapshot 408s | 408s |class X: 408s | def __init__(self,a): 408s | self.a=a 408s | pass 408s | 408s | def __repr__(self): 408s | return f'X("{self.a}")' 408s | 408s | def __eq__(self,other): 408s | if not hasattr(other,"a"): 408s | return NotImplemented 408s | return other.a==self.a 408s | 408s |assert X("a") == snapshot() 408s _____________________________ test_trailing_comma ______________________________ 408s 408s project = .Project object at 0xf2e63bb8> 408s 408s def test_trailing_comma(project): 408s 408s project.setup( 408s """\ 408s from inline_snapshot import external, snapshot 408s 408s class X: 408s def __init__(self, *args): 408s self.args = args 408s 408s def __repr__(self): 408s return f"X({', '.join(map(repr,self.args))})" 408s 408s def __eq__(self,other): 408s if not isinstance(other,X): 408s return NotImplemented 408s 408s return self.args == other.args 408s 408s def test_thing(): 408s assert X("a" * 40, "a" * 40) == snapshot() 408s """ 408s ) 408s 408s > project.format() 408s 408s /tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_inline_snapshot.py:805: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py:315: in format 408s format_code(self._filename.read_text("utf-8"), self._filename), "utf-8" 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s 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' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_trailing_comma0/test_file.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s write code: 408s # äöß 🐍 408s from inline_snapshot import snapshot 408s from inline_snapshot import outsource 408s from inline_snapshot import external, snapshot 408s 408s class X: 408s def __init__(self, *args): 408s self.args = args 408s 408s def __repr__(self): 408s return f"X({', '.join(map(repr,self.args))})" 408s 408s def __eq__(self,other): 408s if not isinstance(other,X): 408s return NotImplemented 408s 408s return self.args == other.args 408s 408s def test_thing(): 408s assert X("a" * 40, "a" * 40) == snapshot() 408s 408s ___________________________________ test_is ____________________________________ 408s 408s def test_is(): 408s 408s Example( 408s """ 408s from inline_snapshot import snapshot,Is 408s 408s def test_Is(): 408s for i in range(3): 408s assert ["hello",i] == snapshot(["hi",Is(i)]) 408s assert ["hello",i] == snapshot({1:["hi",Is(i)]})[i] 408s """ 408s > ).run_inline( 408s ["--inline-snapshot=create"], 408s changed_files=snapshot( 408s { 408s "test_something.py": """\ 408s 408s from inline_snapshot import snapshot,Is 408s 408s def test_Is(): 408s for i in range(3): 408s assert ["hello",i] == snapshot(["hi",Is(i)]) 408s assert ["hello",i] == snapshot({1:["hi",Is(i)], 0: ["hello", 0], 2: ["hello", 2]})[i] 408s """ 408s } 408s ), 408s ).run_inline( 408s ["--inline-snapshot=fix"], 408s changed_files=snapshot( 408s { 408s "test_something.py": """\ 408s 408s from inline_snapshot import snapshot,Is 408s 408s def test_Is(): 408s for i in range(3): 408s assert ["hello",i] == snapshot(["hello",Is(i)]) 408s assert ["hello",i] == snapshot({1:["hello",Is(i)], 0: ["hello", 0], 2: ["hello", 2]})[i] 408s """ 408s } 408s ), 408s ) 408s 408s tests/test_inline_snapshot.py:912: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s self = 408s args = ['--inline-snapshot=create'] 408s 408s def run_inline( 408s self, 408s args: list[str] = [], 408s *, 408s reported_categories: Snapshot[list[Category]] | None = None, 408s changed_files: Snapshot[dict[str, str]] | None = None, 408s report: Snapshot[str] | None = None, 408s raises: Snapshot[str] | None = None, 408s ) -> Example: 408s """Execute the example files in process and run every `test_*` 408s function. 408s 408s This is useful for fast test execution. 408s 408s Parameters: 408s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 408s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 408s changed_files: snapshot of files which are changed by this run. 408s raises: snapshot of the exception which is raised during the test execution. 408s It is required if your code raises an exception. 408s 408s Returns: 408s A new Example instance which contains the changed files. 408s """ 408s 408s parser = ArgumentParser() 408s 408s parser.add_argument( 408s "--inline-snapshot", 408s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 408s dest="inline_snapshot", 408s help="update specific snapshot values:\n" 408s "disable: disable the snapshot logic\n" 408s "short-report: show a short report\n" 408s "report: show a longer report with a diff report\n" 408s "review: allow to approve the changes interactive\n" 408s "create: creates snapshots which are currently not defined\n" 408s "update: update snapshots even if they are defined\n" 408s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 408s "fix: change snapshots which currently break your tests\n", 408s ) 408s parsed_args = parser.parse_args(args) 408s flags = (parsed_args.inline_snapshot or "").split(",") 408s 408s with TemporaryDirectory() as dir: 408s tmp_path = Path(dir) 408s 408s self._write_files(tmp_path) 408s 408s raised_exception = None 408s with snapshot_env(): 408s with ChangeRecorder().activate() as recorder: 408s _inline_snapshot._update_flags = Flags({*flags}) 408s inline_snapshot._external.storage = ( 408s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 408s ) 408s 408s try: 408s for filename in tmp_path.glob("*.py"): 408s globals: dict[str, Any] = {} 408s print("run> pytest", filename) 408s exec( 408s compile(filename.read_text("utf-8"), filename, "exec"), 408s globals, 408s ) 408s 408s # run all test_* functions 408s for k, v in globals.items(): 408s if k.startswith("test_") and callable(v): 408s v() 408s except Exception as e: 408s traceback.print_exc() 408s raised_exception = e 408s 408s finally: 408s _inline_snapshot._active = False 408s 408s changes = [] 408s for snapshot in _inline_snapshot.snapshots.values(): 408s changes += snapshot._changes() 408s 408s snapshot_flags = {change.flag for change in changes} 408s 408s apply_all( 408s [ 408s change 408s for change in changes 408s if change.flag in _inline_snapshot._update_flags.to_set() 408s ] 408s ) 408s recorder.fix_all() 408s 408s report_output = StringIO() 408s console = Console(file=report_output) 408s 408s # TODO: add all the report output here 408s report_problems(console) 408s 408s if reported_categories is not None: 408s assert sorted(snapshot_flags) == reported_categories 408s 408s if raised_exception is not None: 408s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 408s raised_exception 408s ) 408s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 408s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s 408s from inline_snapshot import snapshot,Is 408s 408s def test_Is(): 408s for i in range(3): 408s assert ["hello",i] == snapshot(["hi",Is(i)]) 408s assert ["hello",i] == snapshot({1:["hi",Is(i)]})[i] 408s 408s 408s run> pytest /tmp/tmp1_7a_cb3/test_something.py 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 408s v() 408s File "/tmp/tmp1_7a_cb3/test_something.py", line 6, in test_Is 408s assert ["hello",i] == snapshot(["hi",Is(i)]) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 408s return self == other 408s ^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 408s self._changes.append(next(it)) 408s ^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py", line 79, in assign 408s v = yield from self.get_adapter( 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 408s new_code = self.context.file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s _______________________________ test_missing_is ________________________________ 408s 408s def test_missing_is(): 408s 408s Example( 408s """\ 408s from inline_snapshot import snapshot 408s 408s def test_is(): 408s for i in (1,2): 408s assert i == snapshot(i) 408s """ 408s > ).run_inline( 408s raises=snapshot( 408s """\ 408s UsageError: 408s snapshot value should not change. Use Is(...) for dynamic snapshot parts.\ 408s """ 408s ) 408s ) 408s 408s tests/test_is.py:15: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline 408s assert raises == f"{type(raised_exception).__name__}:\n" + str( 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' 408s filename = PosixPath('/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_is.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot 408s 408s def test_is(): 408s for i in (1,2): 408s assert i == snapshot(i) 408s 408s 408s run> pytest /tmp/tmpfhy4i2op/test_something.py 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 408s v() 408s File "/tmp/tmpfhy4i2op/test_something.py", line 5, in test_is 408s assert i == snapshot(i) 408s ^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 408s return self == other 408s ^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 408s self._changes.append(next(it)) 408s ^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 408s new_code = self.context.file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s __________________________________ test_repr ___________________________________ 408s 408s def test_repr(): 408s Example( 408s """\ 408s from inline_snapshot import snapshot 408s from tests._is_normalized import IsNormalized 408s 408s def test_a(): 408s n=IsNormalized(sorted,snapshot()) 408s assert [3,5,2] == n 408s assert repr(n)==snapshot() 408s """ 408s > ).run_inline( 408s ["--inline-snapshot=create"], 408s changed_files=snapshot( 408s { 408s "test_something.py": """\ 408s from inline_snapshot import snapshot 408s from tests._is_normalized import IsNormalized 408s 408s def test_a(): 408s n=IsNormalized(sorted,snapshot([2, 3, 5])) 408s assert [3,5,2] == n 408s assert repr(n)==snapshot("IsNormalized([2, 3, 5], should_be=[2, 3, 5])") 408s """ 408s } 408s ), 408s ) 408s 408s tests/test_is_normalized.py:16: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s self = 408s args = ['--inline-snapshot=create'] 408s 408s def run_inline( 408s self, 408s args: list[str] = [], 408s *, 408s reported_categories: Snapshot[list[Category]] | None = None, 408s changed_files: Snapshot[dict[str, str]] | None = None, 408s report: Snapshot[str] | None = None, 408s raises: Snapshot[str] | None = None, 408s ) -> Example: 408s """Execute the example files in process and run every `test_*` 408s function. 408s 408s This is useful for fast test execution. 408s 408s Parameters: 408s args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). 408s reported_categories: snapshot of categories which inline-snapshot thinks could be applied. 408s changed_files: snapshot of files which are changed by this run. 408s raises: snapshot of the exception which is raised during the test execution. 408s It is required if your code raises an exception. 408s 408s Returns: 408s A new Example instance which contains the changed files. 408s """ 408s 408s parser = ArgumentParser() 408s 408s parser.add_argument( 408s "--inline-snapshot", 408s metavar="(disable,short-report,report,review,create,update,trim,fix)*", 408s dest="inline_snapshot", 408s help="update specific snapshot values:\n" 408s "disable: disable the snapshot logic\n" 408s "short-report: show a short report\n" 408s "report: show a longer report with a diff report\n" 408s "review: allow to approve the changes interactive\n" 408s "create: creates snapshots which are currently not defined\n" 408s "update: update snapshots even if they are defined\n" 408s "trim: changes the snapshot in a way which will make the snapshot more precise.\n" 408s "fix: change snapshots which currently break your tests\n", 408s ) 408s parsed_args = parser.parse_args(args) 408s flags = (parsed_args.inline_snapshot or "").split(",") 408s 408s with TemporaryDirectory() as dir: 408s tmp_path = Path(dir) 408s 408s self._write_files(tmp_path) 408s 408s raised_exception = None 408s with snapshot_env(): 408s with ChangeRecorder().activate() as recorder: 408s _inline_snapshot._update_flags = Flags({*flags}) 408s inline_snapshot._external.storage = ( 408s inline_snapshot._external.DiscStorage(tmp_path / ".storage") 408s ) 408s 408s try: 408s for filename in tmp_path.glob("*.py"): 408s globals: dict[str, Any] = {} 408s print("run> pytest", filename) 408s exec( 408s compile(filename.read_text("utf-8"), filename, "exec"), 408s globals, 408s ) 408s 408s # run all test_* functions 408s for k, v in globals.items(): 408s if k.startswith("test_") and callable(v): 408s v() 408s except Exception as e: 408s traceback.print_exc() 408s raised_exception = e 408s 408s finally: 408s _inline_snapshot._active = False 408s 408s changes = [] 408s for snapshot in _inline_snapshot.snapshots.values(): 408s changes += snapshot._changes() 408s 408s snapshot_flags = {change.flag for change in changes} 408s 408s apply_all( 408s [ 408s change 408s for change in changes 408s if change.flag in _inline_snapshot._update_flags.to_set() 408s ] 408s ) 408s recorder.fix_all() 408s 408s report_output = StringIO() 408s console = Console(file=report_output) 408s 408s # TODO: add all the report output here 408s report_problems(console) 408s 408s if reported_categories is not None: 408s assert sorted(snapshot_flags) == reported_categories 408s 408s if raised_exception is not None: 408s > assert raises == f"{type(raised_exception).__name__}:\n" + str( 408s raised_exception 408s ) 408s E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") 408s E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError 408s ----------------------------- Captured stdout call ----------------------------- 408s file: test_something.py 408s from inline_snapshot import snapshot 408s from tests._is_normalized import IsNormalized 408s 408s def test_a(): 408s n=IsNormalized(sorted,snapshot()) 408s assert [3,5,2] == n 408s assert repr(n)==snapshot() 408s 408s 408s run> pytest /tmp/tmp0ikbs3zm/test_something.py 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline 408s v() 408s File "/tmp/tmp0ikbs3zm/test_something.py", line 6, in test_a 408s assert [3,5,2] == n 408s ^^^^^^^^^^^^ 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/_is_normalized.py", line 13, in __eq__ 408s return self._last_value == self._value 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ 408s return self == other 408s ^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ 408s self._changes.append(next(it)) 408s ^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign 408s new_code = self.context.file._token_to_code(new_token) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format 408s return format_code(text, Path(self._source.filename)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 408s runner = CliRunner(mix_stderr=False) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s ______________________________ test_fix_list_fix _______________________________ 408s 408s check_update = .w at 0xf2ed7ac8> 408s 408s def test_fix_list_fix(check_update): 408s > assert check_update( 408s """assert [1,2]==snapshot([0+1,3])""", reported_flags="update,fix", flags="fix" 408s ) == snapshot("assert [1,2]==snapshot([0+1,2])") 408s 408s tests/test_preserve_values.py:9: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:49: in w 408s s = source(source_code) 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_fix_list_fix0/test_1.py:9: in 408s assert [1,2]==snapshot([0+1,3]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '1 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_list_fix0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [1,2]==snapshot([0+1,3]) 408s _____________________________ test_fix_list_insert _____________________________ 408s 408s check_update = .w at 0xf2e7b848> 408s 408s def test_fix_list_insert(check_update): 408s > assert check_update( 408s """assert [1,2,3,4,5,6]==snapshot([0+1,3])""", 408s reported_flags="update,fix", 408s flags="fix", 408s ) == snapshot("assert [1,2,3,4,5,6]==snapshot([0+1, 2, 3, 4, 5, 6])") 408s 408s tests/test_preserve_values.py:15: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:49: in w 408s s = source(source_code) 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_fix_list_insert0/test_1.py:9: in 408s assert [1,2,3,4,5,6]==snapshot([0+1,3]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '1 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_list_insert0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [1,2,3,4,5,6]==snapshot([0+1,3]) 408s _____________________________ test_fix_list_delete _____________________________ 408s 408s check_update = .w at 0xf2e7b898> 408s 408s def test_fix_list_delete(check_update): 408s > assert check_update( 408s """assert [1,5]==snapshot([0+1,2,3,4,5])""", 408s reported_flags="update,fix", 408s flags="fix", 408s ) == snapshot("assert [1,5]==snapshot([0+1, 5])") 408s 408s tests/test_preserve_values.py:23: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:49: in w 408s s = source(source_code) 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_fix_list_delete0/test_1.py:9: in 408s assert [1,5]==snapshot([0+1,2,3,4,5]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '1 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_list_delete0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [1,5]==snapshot([0+1,2,3,4,5]) 408s ____________________________ test_fix_tuple_delete _____________________________ 408s 408s check_update = .w at 0xf2dfa668> 408s 408s def test_fix_tuple_delete(check_update): 408s > assert check_update( 408s """assert (1,5)==snapshot((0+1,2,3,4,5))""", 408s reported_flags="update,fix", 408s flags="fix", 408s ) == snapshot("assert (1,5)==snapshot((0+1, 5))") 408s 408s tests/test_preserve_values.py:31: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:49: in w 408s s = source(source_code) 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_fix_tuple_delete0/test_1.py:9: in 408s assert (1,5)==snapshot((0+1,2,3,4,5)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '1 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_tuple_delete0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (1,5)==snapshot((0+1,2,3,4,5)) 408s _____________________________ test_fix_dict_change _____________________________ 408s 408s check_update = .w at 0xf2dfa348> 408s 408s def test_fix_dict_change(check_update): 408s > assert check_update( 408s """assert {1:1, 2:2}==snapshot({1:0+1, 2:3})""", 408s reported_flags="update,fix", 408s flags="fix", 408s ) == snapshot("assert {1:1, 2:2}==snapshot({1:0+1, 2:2})") 408s 408s tests/test_preserve_values.py:39: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:49: in w 408s s = source(source_code) 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_change0/test_1.py:9: in 408s assert {1:1, 2:2}==snapshot({1:0+1, 2:3}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '1 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_change0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {1:1, 2:2}==snapshot({1:0+1, 2:3}) 408s _____________________________ test_fix_dict_remove _____________________________ 408s 408s check_update = .w at 0xf2dfaf78> 408s 408s def test_fix_dict_remove(check_update): 408s > assert check_update( 408s """assert {1:1}==snapshot({0:0, 1:0+1, 2:2})""", 408s reported_flags="update,fix", 408s flags="fix", 408s ) == snapshot("assert {1:1}==snapshot({1:0+1})") 408s 408s tests/test_preserve_values.py:47: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:49: in w 408s s = source(source_code) 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_remove0/test_1.py:9: in 408s assert {1:1}==snapshot({0:0, 1:0+1, 2:2}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '1 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_remove0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {1:1}==snapshot({0:0, 1:0+1, 2:2}) 408s _____________________________ test_fix_dict_insert _____________________________ 408s 408s check_update = .w at 0xf2dfaa28> 408s 408s def test_fix_dict_insert(check_update): 408s > assert check_update( 408s """assert {0:"before",1:1,2:"after"}==snapshot({1:0+1})""", 408s reported_flags="update,fix", 408s flags="fix", 408s ) == snapshot( 408s 'assert {0:"before",1:1,2:"after"}==snapshot({0: "before", 1:0+1, 2: "after"})' 408s ) 408s 408s tests/test_preserve_values.py:61: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:49: in w 408s s = source(source_code) 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_insert0/test_1.py:9: in 408s assert {0:"before",1:1,2:"after"}==snapshot({1:0+1}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '1 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_insert0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {0:"before",1:1,2:"after"}==snapshot({1:0+1}) 408s _____________________ test_fix_dict_with_non_literal_keys ______________________ 408s 408s check_update = .w at 0xf2dfa488> 408s 408s def test_fix_dict_with_non_literal_keys(check_update): 408s > assert check_update( 408s """assert {1+2:"3"}==snapshot({1+2:"5"})""", 408s reported_flags="fix", 408s flags="fix", 408s ) == snapshot('assert {1+2:"3"}==snapshot({1+2:"3"})') 408s 408s tests/test_preserve_values.py:71: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:49: in w 408s s = source(source_code) 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_with_non_literal0/test_1.py:9: in 408s assert {1+2:"3"}==snapshot({1+2:"5"}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = "'3'" 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix_dict_with_non_literal0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {1+2:"3"}==snapshot({1+2:"5"}) 408s _______________________ test_no_update_for_dirty_equals ________________________ 408s 408s check_update = .w at 0xf2dee848> 408s 408s @pytest.mark.skipif( 408s sys.version_info < (3, 8), reason="dirty equals has dropped the 3.7 support" 408s ) 408s def test_no_update_for_dirty_equals(check_update): 408s assert ( 408s > check_update( 408s """\ 408s from dirty_equals import IsInt 408s assert {5:5,2:2}==snapshot({5:IsInt(),2:1+1}) 408s """, 408s reported_flags="update", 408s flags="update", 408s ) 408s == snapshot( 408s """\ 408s from dirty_equals import IsInt 408s assert {5:5,2:2}==snapshot({5:IsInt(),2:2}) 408s """ 408s ) 408s ) 408s 408s tests/test_preserve_values.py:83: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:49: in w 408s s = source(source_code) 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_no_update_for_dirty_equal0/test_1.py:10: in 408s assert {5:5,2:2}==snapshot({5:IsInt(),2:1+1}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '2 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_no_update_for_dirty_equal0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |from dirty_equals import IsInt 408s |assert {5:5,2:2}==snapshot({5:IsInt(),2:1+1}) 408s _____________________ test_preserve_case_from_original_mr ______________________ 408s 408s check_update = .w at 0xf2dee5c8> 408s 408s def test_preserve_case_from_original_mr(check_update): 408s assert ( 408s > check_update( 408s """\ 408s left = { 408s "a": 1, 408s "b": { 408s "c": 2, 408s "d": [ 408s 3, 408s 4, 408s 5, 408s ], 408s }, 408s "e": ( 408s { 408s "f": 6, 408s "g": 7, 408s }, 408s ), 408s } 408s assert left == snapshot( 408s { 408s "a": 10, 408s "b": { 408s "c": 2 * 1 + 0, 408s "d": [ 408s int(3), 408s 40, 408s 5, 408s ], 408s "h": 8, 408s }, 408s "e": ( 408s { 408s "f": 3 + 3, 408s }, 408s 9, 408s ), 408s } 408s ) 408s """, 408s reported_flags="update,fix", 408s flags="fix", 408s ) 408s == snapshot( 408s """\ 408s left = { 408s "a": 1, 408s "b": { 408s "c": 2, 408s "d": [ 408s 3, 408s 4, 408s 5, 408s ], 408s }, 408s "e": ( 408s { 408s "f": 6, 408s "g": 7, 408s }, 408s ), 408s } 408s assert left == snapshot( 408s { 408s "a": 1, 408s "b": { 408s "c": 2 * 1 + 0, 408s "d": [ 408s int(3), 408s 4, 408s 5, 408s ]}, 408s "e": ({"f": 6, "g": 7},), 408s } 408s ) 408s """ 408s ) 408s ) 408s 408s tests/test_preserve_values.py:103: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:49: in w 408s s = source(source_code) 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_preserve_case_from_origin0/test_1.py:26: in 408s assert left == snapshot( 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '1 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_preserve_case_from_origin0/test_1.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |left = { 408s | "a": 1, 408s | "b": { 408s | "c": 2, 408s | "d": [ 408s | 3, 408s | 4, 408s | 5, 408s | ], 408s | }, 408s | "e": ( 408s | { 408s | "f": 6, 408s | "g": 7, 408s | }, 408s | ), 408s |} 408s |assert left == snapshot( 408s | { 408s | "a": 10, 408s | "b": { 408s | "c": 2 * 1 + 0, 408s | "d": [ 408s | int(3), 408s | 40, 408s | 5, 408s | ], 408s | "h": 8, 408s | }, 408s | "e": ( 408s | { 408s | "f": 3 + 3, 408s | }, 408s | 9, 408s | ), 408s | } 408s |) 408s _____________________ test_generic [[5, 5, 5] -> [] ] _____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s s1 = source(code) 408s print("source:", code) 408s 408s assert set(s1.flags) == flags 408s 408s assert ("fix" in flags) == s1.error 408s 408s for f in all_flags: 408s c3 = build( 408s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 408s ) 408s new_code = f"assert {c2}==snapshot({c3})" 408s 408s print(f"{set(f)}:") 408s print(" ", code) 408s print(" ", new_code) 408s > s2 = s1.run(*f) 408s 408s tests/test_preserve_values.py:245: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:137: in run 408s recorder.fix_all() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 408s file.rewrite() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 408s new_code = self.new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 408s format_whole_file = enforce_formatting() or code == format_code( 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s 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])' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_3.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert []==snapshot([5, 5, 5]) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert []==snapshot([5, 5, 5]) 408s source: assert []==snapshot([5, 5, 5]) 408s set(): 408s assert []==snapshot([5, 5, 5]) 408s assert []==snapshot([5, 5, 5]) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert []==snapshot([5, 5, 5]) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert []==snapshot([5, 5, 5]) 408s {'fix'}: 408s assert []==snapshot([5, 5, 5]) 408s assert []==snapshot([]) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert []==snapshot([5, 5, 5]) 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_1.py", line 9, in 408s assert []==snapshot([5, 5, 5]) 408s ^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_2.py", line 9, in 408s assert []==snapshot([5, 5, 5]) 408s ^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________________ test_generic [[5, 5] -> [8] ] ______________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_4.py:9: in 408s assert [8]==snapshot([5, 5]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_4.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [8]==snapshot([5, 5]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [[5, 5, 2+2] -> [4] ] ________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_5.py:9: in 408s assert [4]==snapshot([5, 5, 2+2]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_5.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [4]==snapshot([5, 5, 2+2]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________________ test_generic [[5, 5, 3] -> [3] ] _____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s s1 = source(code) 408s print("source:", code) 408s 408s assert set(s1.flags) == flags 408s 408s assert ("fix" in flags) == s1.error 408s 408s for f in all_flags: 408s c3 = build( 408s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 408s ) 408s new_code = f"assert {c2}==snapshot({c3})" 408s 408s print(f"{set(f)}:") 408s print(" ", code) 408s print(" ", new_code) 408s > s2 = s1.run(*f) 408s 408s tests/test_preserve_values.py:245: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:137: in run 408s recorder.fix_all() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 408s file.rewrite() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 408s new_code = self.new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 408s format_whole_file = enforce_formatting() or code == format_code( 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s 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])' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_8.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3]==snapshot([5, 5, 3]) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert [3]==snapshot([5, 5, 3]) 408s source: assert [3]==snapshot([5, 5, 3]) 408s set(): 408s assert [3]==snapshot([5, 5, 3]) 408s assert [3]==snapshot([5, 5, 3]) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3]==snapshot([5, 5, 3]) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert [3]==snapshot([5, 5, 3]) 408s {'fix'}: 408s assert [3]==snapshot([5, 5, 3]) 408s assert [3]==snapshot([3]) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3]==snapshot([5, 5, 3]) 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_6.py", line 9, in 408s assert [3]==snapshot([5, 5, 3]) 408s ^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_7.py", line 9, in 408s assert [3]==snapshot([5, 5, 3]) 408s ^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________________ test_generic [[5, 5] -> [8] ] ______________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_9.py:9: in 408s assert [8]==snapshot([5, 5]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_9.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [8]==snapshot([5, 5]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________________ test_generic [[5] -> [8, 8] ] ______________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_10.py:9: in 408s assert [8, 8]==snapshot([5]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_10.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [8, 8]==snapshot([5]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [[5, 2+2] -> [8, 4] ] ________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_11.py:9: in 408s assert [8, 4]==snapshot([5, 2+2]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_11.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [8, 4]==snapshot([5, 2+2]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________________ test_generic [[5, 3] -> [8, 3] ] _____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_12.py:9: in 408s assert [8, 3]==snapshot([5, 3]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_12.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [8, 3]==snapshot([5, 3]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [[5, 2+2, 5] -> [4] ] ________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_13.py:9: in 408s assert [4]==snapshot([5, 2+2, 5]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_13.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [4]==snapshot([5, 2+2, 5]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [[5, 2+2] -> [4, 8] ] ________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_14.py:9: in 408s assert [4, 8]==snapshot([5, 2+2]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_14.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [4, 8]==snapshot([5, 2+2]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____________ test_generic [[5, 2+2, 2+2] -> [4, 4] ] _____________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_15.py:9: in 408s assert [4, 4]==snapshot([5, 2+2, 2+2]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_15.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [4, 4]==snapshot([5, 2+2, 2+2]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [[5, 2+2, 3] -> [4, 3] ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_16.py:9: in 408s assert [4, 3]==snapshot([5, 2+2, 3]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_16.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [4, 3]==snapshot([5, 2+2, 3]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________________ test_generic [[5, 3, 5] -> [3] ] _____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s s1 = source(code) 408s print("source:", code) 408s 408s assert set(s1.flags) == flags 408s 408s assert ("fix" in flags) == s1.error 408s 408s for f in all_flags: 408s c3 = build( 408s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 408s ) 408s new_code = f"assert {c2}==snapshot({c3})" 408s 408s print(f"{set(f)}:") 408s print(" ", code) 408s print(" ", new_code) 408s > s2 = s1.run(*f) 408s 408s tests/test_preserve_values.py:245: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:137: in run 408s recorder.fix_all() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 408s file.rewrite() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 408s new_code = self.new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 408s format_whole_file = enforce_formatting() or code == format_code( 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s 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])' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_19.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3]==snapshot([5, 3, 5]) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert [3]==snapshot([5, 3, 5]) 408s source: assert [3]==snapshot([5, 3, 5]) 408s set(): 408s assert [3]==snapshot([5, 3, 5]) 408s assert [3]==snapshot([5, 3, 5]) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3]==snapshot([5, 3, 5]) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert [3]==snapshot([5, 3, 5]) 408s {'fix'}: 408s assert [3]==snapshot([5, 3, 5]) 408s assert [3]==snapshot([3]) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3]==snapshot([5, 3, 5]) 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_17.py", line 9, in 408s assert [3]==snapshot([5, 3, 5]) 408s ^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_18.py", line 9, in 408s assert [3]==snapshot([5, 3, 5]) 408s ^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________________ test_generic [[5, 3] -> [3, 8] ] _____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_20.py:9: in 408s assert [3, 8]==snapshot([5, 3]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_20.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3, 8]==snapshot([5, 3]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [[5, 3, 2+2] -> [3, 4] ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_21.py:9: in 408s assert [3, 4]==snapshot([5, 3, 2+2]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_21.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3, 4]==snapshot([5, 3, 2+2]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ___________________ test_generic [[5, 3, 3] -> [3, 3] ] ___________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s s1 = source(code) 408s print("source:", code) 408s 408s assert set(s1.flags) == flags 408s 408s assert ("fix" in flags) == s1.error 408s 408s for f in all_flags: 408s c3 = build( 408s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 408s ) 408s new_code = f"assert {c2}==snapshot({c3})" 408s 408s print(f"{set(f)}:") 408s print(" ", code) 408s print(" ", new_code) 408s > s2 = s1.run(*f) 408s 408s tests/test_preserve_values.py:245: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:137: in run 408s recorder.fix_all() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 408s file.rewrite() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 408s new_code = self.new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 408s format_whole_file = enforce_formatting() or code == format_code( 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s 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])' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_24.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3, 3]==snapshot([5, 3, 3]) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert [3, 3]==snapshot([5, 3, 3]) 408s source: assert [3, 3]==snapshot([5, 3, 3]) 408s set(): 408s assert [3, 3]==snapshot([5, 3, 3]) 408s assert [3, 3]==snapshot([5, 3, 3]) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3, 3]==snapshot([5, 3, 3]) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert [3, 3]==snapshot([5, 3, 3]) 408s {'fix'}: 408s assert [3, 3]==snapshot([5, 3, 3]) 408s assert [3, 3]==snapshot([3, 3]) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3, 3]==snapshot([5, 3, 3]) 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_22.py", line 9, in 408s assert [3, 3]==snapshot([5, 3, 3]) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_23.py", line 9, in 408s assert [3, 3]==snapshot([5, 3, 3]) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________________ test_generic [[5, 5] -> [8] ] ______________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_25.py:9: in 408s assert [8]==snapshot([5, 5]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_25.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [8]==snapshot([5, 5]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________________ test_generic [[5] -> [8, 8] ] ______________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_26.py:9: in 408s assert [8, 8]==snapshot([5]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_26.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [8, 8]==snapshot([5]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [[5, 2+2] -> [8, 4] ] ________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_27.py:9: in 408s assert [8, 4]==snapshot([5, 2+2]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_27.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [8, 4]==snapshot([5, 2+2]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________________ test_generic [[5, 3] -> [8, 3] ] _____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_28.py:9: in 408s assert [8, 3]==snapshot([5, 3]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_28.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [8, 3]==snapshot([5, 3]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________________ test_generic [[5] -> [8, 8] ] ______________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_29.py:9: in 408s assert [8, 8]==snapshot([5]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_29.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [8, 8]==snapshot([5]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____________________ test_generic [[] -> [8, 8, 8] ] _____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_30.py:9: in 408s assert [8, 8, 8]==snapshot([]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_30.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [8, 8, 8]==snapshot([]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [[2+2] -> [8, 8, 4] ] ________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_31.py:9: in 408s assert [8, 8, 4]==snapshot([2+2]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_31.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [8, 8, 4]==snapshot([2+2]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________________ test_generic [[3] -> [8, 8, 3] ] _____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_32.py:9: in 408s assert [8, 8, 3]==snapshot([3]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_32.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [8, 8, 3]==snapshot([3]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [[2+2, 5] -> [8, 4] ] ________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_33.py:9: in 408s assert [8, 4]==snapshot([2+2, 5]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_33.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [8, 4]==snapshot([2+2, 5]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [[2+2] -> [8, 4, 8] ] ________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_34.py:9: in 408s assert [8, 4, 8]==snapshot([2+2]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_34.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [8, 4, 8]==snapshot([2+2]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____________ test_generic [[2+2, 2+2] -> [8, 4, 4] ] _____________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_35.py:9: in 408s assert [8, 4, 4]==snapshot([2+2, 2+2]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_35.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [8, 4, 4]==snapshot([2+2, 2+2]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [[2+2, 3] -> [8, 4, 3] ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_36.py:9: in 408s assert [8, 4, 3]==snapshot([2+2, 3]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_36.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [8, 4, 3]==snapshot([2+2, 3]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________________ test_generic [[3, 5] -> [8, 3] ] _____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_37.py:9: in 408s assert [8, 3]==snapshot([3, 5]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_37.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [8, 3]==snapshot([3, 5]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________________ test_generic [[3] -> [8, 3, 8] ] _____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_38.py:9: in 408s assert [8, 3, 8]==snapshot([3]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_38.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [8, 3, 8]==snapshot([3]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [[3, 2+2] -> [8, 3, 4] ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_39.py:9: in 408s assert [8, 3, 4]==snapshot([3, 2+2]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_39.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [8, 3, 4]==snapshot([3, 2+2]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ___________________ test_generic [[3, 3] -> [8, 3, 3] ] ___________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_40.py:9: in 408s assert [8, 3, 3]==snapshot([3, 3]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_40.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [8, 3, 3]==snapshot([3, 3]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [[2+2, 5, 5] -> [4] ] ________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_41.py:9: in 408s assert [4]==snapshot([2+2, 5, 5]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_41.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [4]==snapshot([2+2, 5, 5]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [[2+2, 5] -> [4, 8] ] ________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_42.py:9: in 408s assert [4, 8]==snapshot([2+2, 5]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_42.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [4, 8]==snapshot([2+2, 5]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____________ test_generic [[2+2, 5, 2+2] -> [4, 4] ] _____________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_43.py:9: in 408s assert [4, 4]==snapshot([2+2, 5, 2+2]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_43.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [4, 4]==snapshot([2+2, 5, 2+2]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [[2+2, 5, 3] -> [4, 3] ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_44.py:9: in 408s assert [4, 3]==snapshot([2+2, 5, 3]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_44.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [4, 3]==snapshot([2+2, 5, 3]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [[2+2, 5] -> [4, 8] ] ________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_45.py:9: in 408s assert [4, 8]==snapshot([2+2, 5]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_45.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [4, 8]==snapshot([2+2, 5]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [[2+2] -> [4, 8, 8] ] ________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_46.py:9: in 408s assert [4, 8, 8]==snapshot([2+2]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_46.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [4, 8, 8]==snapshot([2+2]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____________ test_generic [[2+2, 2+2] -> [4, 8, 4] ] _____________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_47.py:9: in 408s assert [4, 8, 4]==snapshot([2+2, 2+2]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_47.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [4, 8, 4]==snapshot([2+2, 2+2]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [[2+2, 3] -> [4, 8, 3] ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_48.py:9: in 408s assert [4, 8, 3]==snapshot([2+2, 3]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_48.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [4, 8, 3]==snapshot([2+2, 3]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____________ test_generic [[2+2, 2+2, 5] -> [4, 4] ] _____________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_49.py:9: in 408s assert [4, 4]==snapshot([2+2, 2+2, 5]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_49.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [4, 4]==snapshot([2+2, 2+2, 5]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____________ test_generic [[2+2, 2+2] -> [4, 4, 8] ] _____________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_50.py:9: in 408s assert [4, 4, 8]==snapshot([2+2, 2+2]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_50.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [4, 4, 8]==snapshot([2+2, 2+2]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____________ test_generic [[2+2, 2+2, 2+2] -> [4, 4, 4] ] _____________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_51.py:9: in 408s assert [4, 4, 4]==snapshot([2+2, 2+2, 2+2]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_51.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [4, 4, 4]==snapshot([2+2, 2+2, 2+2]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [[2+2, 2+2, 3] -> [4, 4, 3] ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_52.py:9: in 408s assert [4, 4, 3]==snapshot([2+2, 2+2, 3]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_52.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [4, 4, 3]==snapshot([2+2, 2+2, 3]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [[2+2, 3, 5] -> [4, 3] ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_53.py:9: in 408s assert [4, 3]==snapshot([2+2, 3, 5]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_53.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [4, 3]==snapshot([2+2, 3, 5]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [[2+2, 3] -> [4, 3, 8] ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_54.py:9: in 408s assert [4, 3, 8]==snapshot([2+2, 3]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_54.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [4, 3, 8]==snapshot([2+2, 3]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [[2+2, 3, 2+2] -> [4, 3, 4] ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_55.py:9: in 408s assert [4, 3, 4]==snapshot([2+2, 3, 2+2]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_55.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [4, 3, 4]==snapshot([2+2, 3, 2+2]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [[2+2, 3, 3] -> [4, 3, 3] ] _______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_56.py:9: in 408s assert [4, 3, 3]==snapshot([2+2, 3, 3]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_56.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [4, 3, 3]==snapshot([2+2, 3, 3]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________________ test_generic [[3, 5, 5] -> [3] ] _____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s s1 = source(code) 408s print("source:", code) 408s 408s assert set(s1.flags) == flags 408s 408s assert ("fix" in flags) == s1.error 408s 408s for f in all_flags: 408s c3 = build( 408s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 408s ) 408s new_code = f"assert {c2}==snapshot({c3})" 408s 408s print(f"{set(f)}:") 408s print(" ", code) 408s print(" ", new_code) 408s > s2 = s1.run(*f) 408s 408s tests/test_preserve_values.py:245: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:137: in run 408s recorder.fix_all() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 408s file.rewrite() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 408s new_code = self.new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 408s format_whole_file = enforce_formatting() or code == format_code( 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s 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])' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_59.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3]==snapshot([3, 5, 5]) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert [3]==snapshot([3, 5, 5]) 408s source: assert [3]==snapshot([3, 5, 5]) 408s set(): 408s assert [3]==snapshot([3, 5, 5]) 408s assert [3]==snapshot([3, 5, 5]) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3]==snapshot([3, 5, 5]) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert [3]==snapshot([3, 5, 5]) 408s {'fix'}: 408s assert [3]==snapshot([3, 5, 5]) 408s assert [3]==snapshot([3]) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3]==snapshot([3, 5, 5]) 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_57.py", line 9, in 408s assert [3]==snapshot([3, 5, 5]) 408s ^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_58.py", line 9, in 408s assert [3]==snapshot([3, 5, 5]) 408s ^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________________ test_generic [[3, 5] -> [3, 8] ] _____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_60.py:9: in 408s assert [3, 8]==snapshot([3, 5]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_60.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3, 8]==snapshot([3, 5]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [[3, 5, 2+2] -> [3, 4] ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_61.py:9: in 408s assert [3, 4]==snapshot([3, 5, 2+2]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_61.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3, 4]==snapshot([3, 5, 2+2]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ___________________ test_generic [[3, 5, 3] -> [3, 3] ] ___________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s s1 = source(code) 408s print("source:", code) 408s 408s assert set(s1.flags) == flags 408s 408s assert ("fix" in flags) == s1.error 408s 408s for f in all_flags: 408s c3 = build( 408s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 408s ) 408s new_code = f"assert {c2}==snapshot({c3})" 408s 408s print(f"{set(f)}:") 408s print(" ", code) 408s print(" ", new_code) 408s > s2 = s1.run(*f) 408s 408s tests/test_preserve_values.py:245: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:137: in run 408s recorder.fix_all() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 408s file.rewrite() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 408s new_code = self.new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 408s format_whole_file = enforce_formatting() or code == format_code( 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s 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])' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_64.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3, 3]==snapshot([3, 5, 3]) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert [3, 3]==snapshot([3, 5, 3]) 408s source: assert [3, 3]==snapshot([3, 5, 3]) 408s set(): 408s assert [3, 3]==snapshot([3, 5, 3]) 408s assert [3, 3]==snapshot([3, 5, 3]) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3, 3]==snapshot([3, 5, 3]) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert [3, 3]==snapshot([3, 5, 3]) 408s {'fix'}: 408s assert [3, 3]==snapshot([3, 5, 3]) 408s assert [3, 3]==snapshot([3, 3]) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3, 3]==snapshot([3, 5, 3]) 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_62.py", line 9, in 408s assert [3, 3]==snapshot([3, 5, 3]) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_63.py", line 9, in 408s assert [3, 3]==snapshot([3, 5, 3]) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________________ test_generic [[3, 5] -> [3, 8] ] _____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_65.py:9: in 408s assert [3, 8]==snapshot([3, 5]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_65.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3, 8]==snapshot([3, 5]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________________ test_generic [[3] -> [3, 8, 8] ] _____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_66.py:9: in 408s assert [3, 8, 8]==snapshot([3]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_66.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3, 8, 8]==snapshot([3]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [[3, 2+2] -> [3, 8, 4] ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_67.py:9: in 408s assert [3, 8, 4]==snapshot([3, 2+2]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_67.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3, 8, 4]==snapshot([3, 2+2]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ___________________ test_generic [[3, 3] -> [3, 8, 3] ] ___________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_68.py:9: in 408s assert [3, 8, 3]==snapshot([3, 3]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_68.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3, 8, 3]==snapshot([3, 3]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [[3, 2+2, 5] -> [3, 4] ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_69.py:9: in 408s assert [3, 4]==snapshot([3, 2+2, 5]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_69.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3, 4]==snapshot([3, 2+2, 5]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [[3, 2+2] -> [3, 4, 8] ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_70.py:9: in 408s assert [3, 4, 8]==snapshot([3, 2+2]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_70.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3, 4, 8]==snapshot([3, 2+2]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [[3, 2+2, 2+2] -> [3, 4, 4] ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_71.py:9: in 408s assert [3, 4, 4]==snapshot([3, 2+2, 2+2]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_71.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3, 4, 4]==snapshot([3, 2+2, 2+2]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [[3, 2+2, 3] -> [3, 4, 3] ] _______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_72.py:9: in 408s assert [3, 4, 3]==snapshot([3, 2+2, 3]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_72.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3, 4, 3]==snapshot([3, 2+2, 3]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ___________________ test_generic [[3, 3, 5] -> [3, 3] ] ___________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s s1 = source(code) 408s print("source:", code) 408s 408s assert set(s1.flags) == flags 408s 408s assert ("fix" in flags) == s1.error 408s 408s for f in all_flags: 408s c3 = build( 408s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 408s ) 408s new_code = f"assert {c2}==snapshot({c3})" 408s 408s print(f"{set(f)}:") 408s print(" ", code) 408s print(" ", new_code) 408s > s2 = s1.run(*f) 408s 408s tests/test_preserve_values.py:245: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:137: in run 408s recorder.fix_all() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 408s file.rewrite() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 408s new_code = self.new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 408s format_whole_file = enforce_formatting() or code == format_code( 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s 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])' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_75.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3, 3]==snapshot([3, 3, 5]) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert [3, 3]==snapshot([3, 3, 5]) 408s source: assert [3, 3]==snapshot([3, 3, 5]) 408s set(): 408s assert [3, 3]==snapshot([3, 3, 5]) 408s assert [3, 3]==snapshot([3, 3, 5]) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3, 3]==snapshot([3, 3, 5]) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert [3, 3]==snapshot([3, 3, 5]) 408s {'fix'}: 408s assert [3, 3]==snapshot([3, 3, 5]) 408s assert [3, 3]==snapshot([3, 3]) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3, 3]==snapshot([3, 3, 5]) 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_73.py", line 9, in 408s assert [3, 3]==snapshot([3, 3, 5]) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_74.py", line 9, in 408s assert [3, 3]==snapshot([3, 3, 5]) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s ------------------------------ Captured log call ------------------------------- 408s 408s ___________________ test_generic [[3, 3] -> [3, 3, 8] ] ___________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_76.py:9: in 408s assert [3, 3, 8]==snapshot([3, 3]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_76.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3, 3, 8]==snapshot([3, 3]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [[3, 3, 2+2] -> [3, 3, 4] ] _______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_77.py:9: in 408s assert [3, 3, 4]==snapshot([3, 3, 2+2]) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_77.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert [3, 3, 4]==snapshot([3, 3, 2+2]) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____________________ test_generic [(5, 5, 5) -> () ] _____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s s1 = source(code) 408s print("source:", code) 408s 408s assert set(s1.flags) == flags 408s 408s assert ("fix" in flags) == s1.error 408s 408s for f in all_flags: 408s c3 = build( 408s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 408s ) 408s new_code = f"assert {c2}==snapshot({c3})" 408s 408s print(f"{set(f)}:") 408s print(" ", code) 408s print(" ", new_code) 408s > s2 = s1.run(*f) 408s 408s tests/test_preserve_values.py:245: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:137: in run 408s recorder.fix_all() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 408s file.rewrite() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 408s new_code = self.new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 408s format_whole_file = enforce_formatting() or code == format_code( 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s 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))' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_82.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert ()==snapshot((5, 5, 5)) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert ()==snapshot((5, 5, 5)) 408s source: assert ()==snapshot((5, 5, 5)) 408s set(): 408s assert ()==snapshot((5, 5, 5)) 408s assert ()==snapshot((5, 5, 5)) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert ()==snapshot((5, 5, 5)) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert ()==snapshot((5, 5, 5)) 408s {'fix'}: 408s assert ()==snapshot((5, 5, 5)) 408s assert ()==snapshot(()) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert ()==snapshot((5, 5, 5)) 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_80.py", line 9, in 408s assert ()==snapshot((5, 5, 5)) 408s ^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_81.py", line 9, in 408s assert ()==snapshot((5, 5, 5)) 408s ^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____________________ test_generic [(5, 5) -> (8,) ] ______________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_83.py:9: in 408s assert (8,)==snapshot((5, 5)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_83.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (8,)==snapshot((5, 5)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [(5, 5, 2+2) -> (4,) ] _______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_84.py:9: in 408s assert (4,)==snapshot((5, 5, 2+2)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_84.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (4,)==snapshot((5, 5, 2+2)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________________ test_generic [(5, 5, 3) -> (3,) ] ____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s s1 = source(code) 408s print("source:", code) 408s 408s assert set(s1.flags) == flags 408s 408s assert ("fix" in flags) == s1.error 408s 408s for f in all_flags: 408s c3 = build( 408s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 408s ) 408s new_code = f"assert {c2}==snapshot({c3})" 408s 408s print(f"{set(f)}:") 408s print(" ", code) 408s print(" ", new_code) 408s > s2 = s1.run(*f) 408s 408s tests/test_preserve_values.py:245: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:137: in run 408s recorder.fix_all() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 408s file.rewrite() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 408s new_code = self.new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 408s format_whole_file = enforce_formatting() or code == format_code( 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s 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))' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_87.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3,)==snapshot((5, 5, 3)) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert (3,)==snapshot((5, 5, 3)) 408s source: assert (3,)==snapshot((5, 5, 3)) 408s set(): 408s assert (3,)==snapshot((5, 5, 3)) 408s assert (3,)==snapshot((5, 5, 3)) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3,)==snapshot((5, 5, 3)) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert (3,)==snapshot((5, 5, 3)) 408s {'fix'}: 408s assert (3,)==snapshot((5, 5, 3)) 408s assert (3,)==snapshot((3,)) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3,)==snapshot((5, 5, 3)) 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_85.py", line 9, in 408s assert (3,)==snapshot((5, 5, 3)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_86.py", line 9, in 408s assert (3,)==snapshot((5, 5, 3)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____________________ test_generic [(5, 5) -> (8,) ] ______________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_88.py:9: in 408s assert (8,)==snapshot((5, 5)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_88.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (8,)==snapshot((5, 5)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____________________ test_generic [(5,) -> (8, 8) ] ______________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_89.py:9: in 408s assert (8, 8)==snapshot((5,)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_89.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (8, 8)==snapshot((5,)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [(5, 2+2) -> (8, 4) ] ________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_90.py:9: in 408s assert (8, 4)==snapshot((5, 2+2)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_90.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (8, 4)==snapshot((5, 2+2)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________________ test_generic [(5, 3) -> (8, 3) ] _____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_91.py:9: in 408s assert (8, 3)==snapshot((5, 3)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_91.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (8, 3)==snapshot((5, 3)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [(5, 2+2, 5) -> (4,) ] _______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_92.py:9: in 408s assert (4,)==snapshot((5, 2+2, 5)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_92.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (4,)==snapshot((5, 2+2, 5)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [(5, 2+2) -> (4, 8) ] ________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_93.py:9: in 408s assert (4, 8)==snapshot((5, 2+2)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_93.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (4, 8)==snapshot((5, 2+2)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____________ test_generic [(5, 2+2, 2+2) -> (4, 4) ] _____________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_94.py:9: in 408s assert (4, 4)==snapshot((5, 2+2, 2+2)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_94.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (4, 4)==snapshot((5, 2+2, 2+2)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [(5, 2+2, 3) -> (4, 3) ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_95.py:9: in 408s assert (4, 3)==snapshot((5, 2+2, 3)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_95.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (4, 3)==snapshot((5, 2+2, 3)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________________ test_generic [(5, 3, 5) -> (3,) ] ____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s s1 = source(code) 408s print("source:", code) 408s 408s assert set(s1.flags) == flags 408s 408s assert ("fix" in flags) == s1.error 408s 408s for f in all_flags: 408s c3 = build( 408s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 408s ) 408s new_code = f"assert {c2}==snapshot({c3})" 408s 408s print(f"{set(f)}:") 408s print(" ", code) 408s print(" ", new_code) 408s > s2 = s1.run(*f) 408s 408s tests/test_preserve_values.py:245: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:137: in run 408s recorder.fix_all() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 408s file.rewrite() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 408s new_code = self.new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 408s format_whole_file = enforce_formatting() or code == format_code( 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s 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))' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_98.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3,)==snapshot((5, 3, 5)) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert (3,)==snapshot((5, 3, 5)) 408s source: assert (3,)==snapshot((5, 3, 5)) 408s set(): 408s assert (3,)==snapshot((5, 3, 5)) 408s assert (3,)==snapshot((5, 3, 5)) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3,)==snapshot((5, 3, 5)) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert (3,)==snapshot((5, 3, 5)) 408s {'fix'}: 408s assert (3,)==snapshot((5, 3, 5)) 408s assert (3,)==snapshot((3,)) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3,)==snapshot((5, 3, 5)) 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_96.py", line 9, in 408s assert (3,)==snapshot((5, 3, 5)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_97.py", line 9, in 408s assert (3,)==snapshot((5, 3, 5)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________________ test_generic [(5, 3) -> (3, 8) ] _____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_99.py:9: in 408s assert (3, 8)==snapshot((5, 3)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_99.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3, 8)==snapshot((5, 3)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [(5, 3, 2+2) -> (3, 4) ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_100.py:9: in 408s assert (3, 4)==snapshot((5, 3, 2+2)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_100.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3, 4)==snapshot((5, 3, 2+2)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ___________________ test_generic [(5, 3, 3) -> (3, 3) ] ___________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s s1 = source(code) 408s print("source:", code) 408s 408s assert set(s1.flags) == flags 408s 408s assert ("fix" in flags) == s1.error 408s 408s for f in all_flags: 408s c3 = build( 408s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 408s ) 408s new_code = f"assert {c2}==snapshot({c3})" 408s 408s print(f"{set(f)}:") 408s print(" ", code) 408s print(" ", new_code) 408s > s2 = s1.run(*f) 408s 408s tests/test_preserve_values.py:245: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:137: in run 408s recorder.fix_all() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 408s file.rewrite() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 408s new_code = self.new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 408s format_whole_file = enforce_formatting() or code == format_code( 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s 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))' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_103.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3, 3)==snapshot((5, 3, 3)) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert (3, 3)==snapshot((5, 3, 3)) 408s source: assert (3, 3)==snapshot((5, 3, 3)) 408s set(): 408s assert (3, 3)==snapshot((5, 3, 3)) 408s assert (3, 3)==snapshot((5, 3, 3)) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3, 3)==snapshot((5, 3, 3)) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert (3, 3)==snapshot((5, 3, 3)) 408s {'fix'}: 408s assert (3, 3)==snapshot((5, 3, 3)) 408s assert (3, 3)==snapshot((3, 3)) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3, 3)==snapshot((5, 3, 3)) 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_101.py", line 9, in 408s assert (3, 3)==snapshot((5, 3, 3)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_102.py", line 9, in 408s assert (3, 3)==snapshot((5, 3, 3)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____________________ test_generic [(5, 5) -> (8,) ] ______________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_104.py:9: in 408s assert (8,)==snapshot((5, 5)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_104.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (8,)==snapshot((5, 5)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____________________ test_generic [(5,) -> (8, 8) ] ______________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_105.py:9: in 408s assert (8, 8)==snapshot((5,)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_105.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (8, 8)==snapshot((5,)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [(5, 2+2) -> (8, 4) ] ________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_106.py:9: in 408s assert (8, 4)==snapshot((5, 2+2)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_106.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (8, 4)==snapshot((5, 2+2)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________________ test_generic [(5, 3) -> (8, 3) ] _____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_107.py:9: in 408s assert (8, 3)==snapshot((5, 3)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_107.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (8, 3)==snapshot((5, 3)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____________________ test_generic [(5,) -> (8, 8) ] ______________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_108.py:9: in 408s assert (8, 8)==snapshot((5,)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_108.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (8, 8)==snapshot((5,)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____________________ test_generic [() -> (8, 8, 8) ] _____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_109.py:9: in 408s assert (8, 8, 8)==snapshot(()) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_109.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (8, 8, 8)==snapshot(()) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [(2+2,) -> (8, 8, 4) ] _______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_110.py:9: in 408s assert (8, 8, 4)==snapshot((2+2,)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_110.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (8, 8, 4)==snapshot((2+2,)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________________ test_generic [(3,) -> (8, 8, 3) ] ____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_111.py:9: in 408s assert (8, 8, 3)==snapshot((3,)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_111.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (8, 8, 3)==snapshot((3,)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [(2+2, 5) -> (8, 4) ] ________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_112.py:9: in 408s assert (8, 4)==snapshot((2+2, 5)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_112.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (8, 4)==snapshot((2+2, 5)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [(2+2,) -> (8, 4, 8) ] _______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_113.py:9: in 408s assert (8, 4, 8)==snapshot((2+2,)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_113.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (8, 4, 8)==snapshot((2+2,)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____________ test_generic [(2+2, 2+2) -> (8, 4, 4) ] _____________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_114.py:9: in 408s assert (8, 4, 4)==snapshot((2+2, 2+2)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_114.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (8, 4, 4)==snapshot((2+2, 2+2)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [(2+2, 3) -> (8, 4, 3) ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_115.py:9: in 408s assert (8, 4, 3)==snapshot((2+2, 3)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_115.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (8, 4, 3)==snapshot((2+2, 3)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________________ test_generic [(3, 5) -> (8, 3) ] _____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_116.py:9: in 408s assert (8, 3)==snapshot((3, 5)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_116.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (8, 3)==snapshot((3, 5)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________________ test_generic [(3,) -> (8, 3, 8) ] ____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_117.py:9: in 408s assert (8, 3, 8)==snapshot((3,)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_117.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (8, 3, 8)==snapshot((3,)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [(3, 2+2) -> (8, 3, 4) ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_118.py:9: in 408s assert (8, 3, 4)==snapshot((3, 2+2)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_118.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (8, 3, 4)==snapshot((3, 2+2)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ___________________ test_generic [(3, 3) -> (8, 3, 3) ] ___________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_119.py:9: in 408s assert (8, 3, 3)==snapshot((3, 3)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_119.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (8, 3, 3)==snapshot((3, 3)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [(2+2, 5, 5) -> (4,) ] _______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_120.py:9: in 408s assert (4,)==snapshot((2+2, 5, 5)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_120.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (4,)==snapshot((2+2, 5, 5)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [(2+2, 5) -> (4, 8) ] ________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_121.py:9: in 408s assert (4, 8)==snapshot((2+2, 5)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_121.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (4, 8)==snapshot((2+2, 5)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____________ test_generic [(2+2, 5, 2+2) -> (4, 4) ] _____________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_122.py:9: in 408s assert (4, 4)==snapshot((2+2, 5, 2+2)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_122.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (4, 4)==snapshot((2+2, 5, 2+2)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [(2+2, 5, 3) -> (4, 3) ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_123.py:9: in 408s assert (4, 3)==snapshot((2+2, 5, 3)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_123.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (4, 3)==snapshot((2+2, 5, 3)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [(2+2, 5) -> (4, 8) ] ________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_124.py:9: in 408s assert (4, 8)==snapshot((2+2, 5)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_124.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (4, 8)==snapshot((2+2, 5)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [(2+2,) -> (4, 8, 8) ] _______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_125.py:9: in 408s assert (4, 8, 8)==snapshot((2+2,)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_125.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (4, 8, 8)==snapshot((2+2,)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____________ test_generic [(2+2, 2+2) -> (4, 8, 4) ] _____________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_126.py:9: in 408s assert (4, 8, 4)==snapshot((2+2, 2+2)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_126.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (4, 8, 4)==snapshot((2+2, 2+2)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [(2+2, 3) -> (4, 8, 3) ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_127.py:9: in 408s assert (4, 8, 3)==snapshot((2+2, 3)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_127.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (4, 8, 3)==snapshot((2+2, 3)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____________ test_generic [(2+2, 2+2, 5) -> (4, 4) ] _____________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_128.py:9: in 408s assert (4, 4)==snapshot((2+2, 2+2, 5)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_128.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (4, 4)==snapshot((2+2, 2+2, 5)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____________ test_generic [(2+2, 2+2) -> (4, 4, 8) ] _____________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_129.py:9: in 408s assert (4, 4, 8)==snapshot((2+2, 2+2)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_129.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (4, 4, 8)==snapshot((2+2, 2+2)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____________ test_generic [(2+2, 2+2, 2+2) -> (4, 4, 4) ] _____________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_130.py:9: in 408s assert (4, 4, 4)==snapshot((2+2, 2+2, 2+2)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_130.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (4, 4, 4)==snapshot((2+2, 2+2, 2+2)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [(2+2, 2+2, 3) -> (4, 4, 3) ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_131.py:9: in 408s assert (4, 4, 3)==snapshot((2+2, 2+2, 3)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_131.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (4, 4, 3)==snapshot((2+2, 2+2, 3)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [(2+2, 3, 5) -> (4, 3) ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_132.py:9: in 408s assert (4, 3)==snapshot((2+2, 3, 5)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_132.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (4, 3)==snapshot((2+2, 3, 5)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [(2+2, 3) -> (4, 3, 8) ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_133.py:9: in 408s assert (4, 3, 8)==snapshot((2+2, 3)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_133.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (4, 3, 8)==snapshot((2+2, 3)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [(2+2, 3, 2+2) -> (4, 3, 4) ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_134.py:9: in 408s assert (4, 3, 4)==snapshot((2+2, 3, 2+2)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_134.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (4, 3, 4)==snapshot((2+2, 3, 2+2)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [(2+2, 3, 3) -> (4, 3, 3) ] _______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_135.py:9: in 408s assert (4, 3, 3)==snapshot((2+2, 3, 3)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_135.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (4, 3, 3)==snapshot((2+2, 3, 3)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________________ test_generic [(3, 5, 5) -> (3,) ] ____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s s1 = source(code) 408s print("source:", code) 408s 408s assert set(s1.flags) == flags 408s 408s assert ("fix" in flags) == s1.error 408s 408s for f in all_flags: 408s c3 = build( 408s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 408s ) 408s new_code = f"assert {c2}==snapshot({c3})" 408s 408s print(f"{set(f)}:") 408s print(" ", code) 408s print(" ", new_code) 408s > s2 = s1.run(*f) 408s 408s tests/test_preserve_values.py:245: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:137: in run 408s recorder.fix_all() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 408s file.rewrite() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 408s new_code = self.new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 408s format_whole_file = enforce_formatting() or code == format_code( 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s 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))' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_138.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3,)==snapshot((3, 5, 5)) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert (3,)==snapshot((3, 5, 5)) 408s source: assert (3,)==snapshot((3, 5, 5)) 408s set(): 408s assert (3,)==snapshot((3, 5, 5)) 408s assert (3,)==snapshot((3, 5, 5)) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3,)==snapshot((3, 5, 5)) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert (3,)==snapshot((3, 5, 5)) 408s {'fix'}: 408s assert (3,)==snapshot((3, 5, 5)) 408s assert (3,)==snapshot((3,)) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3,)==snapshot((3, 5, 5)) 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_136.py", line 9, in 408s assert (3,)==snapshot((3, 5, 5)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_137.py", line 9, in 408s assert (3,)==snapshot((3, 5, 5)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________________ test_generic [(3, 5) -> (3, 8) ] _____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_139.py:9: in 408s assert (3, 8)==snapshot((3, 5)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_139.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3, 8)==snapshot((3, 5)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [(3, 5, 2+2) -> (3, 4) ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_140.py:9: in 408s assert (3, 4)==snapshot((3, 5, 2+2)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_140.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3, 4)==snapshot((3, 5, 2+2)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ___________________ test_generic [(3, 5, 3) -> (3, 3) ] ___________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s s1 = source(code) 408s print("source:", code) 408s 408s assert set(s1.flags) == flags 408s 408s assert ("fix" in flags) == s1.error 408s 408s for f in all_flags: 408s c3 = build( 408s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 408s ) 408s new_code = f"assert {c2}==snapshot({c3})" 408s 408s print(f"{set(f)}:") 408s print(" ", code) 408s print(" ", new_code) 408s > s2 = s1.run(*f) 408s 408s tests/test_preserve_values.py:245: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:137: in run 408s recorder.fix_all() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 408s file.rewrite() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 408s new_code = self.new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 408s format_whole_file = enforce_formatting() or code == format_code( 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s 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))' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_143.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3, 3)==snapshot((3, 5, 3)) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert (3, 3)==snapshot((3, 5, 3)) 408s source: assert (3, 3)==snapshot((3, 5, 3)) 408s set(): 408s assert (3, 3)==snapshot((3, 5, 3)) 408s assert (3, 3)==snapshot((3, 5, 3)) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3, 3)==snapshot((3, 5, 3)) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert (3, 3)==snapshot((3, 5, 3)) 408s {'fix'}: 408s assert (3, 3)==snapshot((3, 5, 3)) 408s assert (3, 3)==snapshot((3, 3)) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3, 3)==snapshot((3, 5, 3)) 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_141.py", line 9, in 408s assert (3, 3)==snapshot((3, 5, 3)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_142.py", line 9, in 408s assert (3, 3)==snapshot((3, 5, 3)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________________ test_generic [(3, 5) -> (3, 8) ] _____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_144.py:9: in 408s assert (3, 8)==snapshot((3, 5)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_144.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3, 8)==snapshot((3, 5)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ____________________ test_generic [(3,) -> (3, 8, 8) ] ____________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_145.py:9: in 408s assert (3, 8, 8)==snapshot((3,)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_145.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3, 8, 8)==snapshot((3,)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [(3, 2+2) -> (3, 8, 4) ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_146.py:9: in 408s assert (3, 8, 4)==snapshot((3, 2+2)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_146.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3, 8, 4)==snapshot((3, 2+2)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ___________________ test_generic [(3, 3) -> (3, 8, 3) ] ___________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_147.py:9: in 408s assert (3, 8, 3)==snapshot((3, 3)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_147.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3, 8, 3)==snapshot((3, 3)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [(3, 2+2, 5) -> (3, 4) ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_148.py:9: in 408s assert (3, 4)==snapshot((3, 2+2, 5)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_148.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3, 4)==snapshot((3, 2+2, 5)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [(3, 2+2) -> (3, 4, 8) ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_149.py:9: in 408s assert (3, 4, 8)==snapshot((3, 2+2)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_149.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3, 4, 8)==snapshot((3, 2+2)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [(3, 2+2, 2+2) -> (3, 4, 4) ] ______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_150.py:9: in 408s assert (3, 4, 4)==snapshot((3, 2+2, 2+2)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_150.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3, 4, 4)==snapshot((3, 2+2, 2+2)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [(3, 2+2, 3) -> (3, 4, 3) ] _______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_151.py:9: in 408s assert (3, 4, 3)==snapshot((3, 2+2, 3)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_151.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3, 4, 3)==snapshot((3, 2+2, 3)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ___________________ test_generic [(3, 3, 5) -> (3, 3) ] ___________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s s1 = source(code) 408s print("source:", code) 408s 408s assert set(s1.flags) == flags 408s 408s assert ("fix" in flags) == s1.error 408s 408s for f in all_flags: 408s c3 = build( 408s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 408s ) 408s new_code = f"assert {c2}==snapshot({c3})" 408s 408s print(f"{set(f)}:") 408s print(" ", code) 408s print(" ", new_code) 408s > s2 = s1.run(*f) 408s 408s tests/test_preserve_values.py:245: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:137: in run 408s recorder.fix_all() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 408s file.rewrite() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 408s new_code = self.new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 408s format_whole_file = enforce_formatting() or code == format_code( 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s 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))' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_154.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3, 3)==snapshot((3, 3, 5)) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert (3, 3)==snapshot((3, 3, 5)) 408s source: assert (3, 3)==snapshot((3, 3, 5)) 408s set(): 408s assert (3, 3)==snapshot((3, 3, 5)) 408s assert (3, 3)==snapshot((3, 3, 5)) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3, 3)==snapshot((3, 3, 5)) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert (3, 3)==snapshot((3, 3, 5)) 408s {'fix'}: 408s assert (3, 3)==snapshot((3, 3, 5)) 408s assert (3, 3)==snapshot((3, 3)) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3, 3)==snapshot((3, 3, 5)) 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_152.py", line 9, in 408s assert (3, 3)==snapshot((3, 3, 5)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_153.py", line 9, in 408s assert (3, 3)==snapshot((3, 3, 5)) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s ------------------------------ Captured log call ------------------------------- 408s 408s ___________________ test_generic [(3, 3) -> (3, 3, 8) ] ___________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_155.py:9: in 408s assert (3, 3, 8)==snapshot((3, 3)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign 408s new_code = self.context.file._value_to_code(new_value_element) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '8 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_155.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3, 3, 8)==snapshot((3, 3)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _______________ test_generic [(3, 3, 2+2) -> (3, 3, 4) ] _______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_156.py:9: in 408s assert (3, 3, 4)==snapshot((3, 3, 2+2)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign 408s v = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_156.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert (3, 3, 4)==snapshot((3, 3, 2+2)) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ________________ test_generic [{0: 5, 1: 5, 2: 5} -> {} ] _________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s s1 = source(code) 408s print("source:", code) 408s 408s assert set(s1.flags) == flags 408s 408s assert ("fix" in flags) == s1.error 408s 408s for f in all_flags: 408s c3 = build( 408s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 408s ) 408s new_code = f"assert {c2}==snapshot({c3})" 408s 408s print(f"{set(f)}:") 408s print(" ", code) 408s print(" ", new_code) 408s > s2 = s1.run(*f) 408s 408s tests/test_preserve_values.py:245: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:137: in run 408s recorder.fix_all() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 408s file.rewrite() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 408s new_code = self.new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 408s format_whole_file = enforce_formatting() or code == format_code( 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s 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})' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_161.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {}==snapshot({0: 5, 1: 5, 2: 5}) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert {}==snapshot({0: 5, 1: 5, 2: 5}) 408s source: assert {}==snapshot({0: 5, 1: 5, 2: 5}) 408s set(): 408s assert {}==snapshot({0: 5, 1: 5, 2: 5}) 408s assert {}==snapshot({0: 5, 1: 5, 2: 5}) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {}==snapshot({0: 5, 1: 5, 2: 5}) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert {}==snapshot({0: 5, 1: 5, 2: 5}) 408s {'fix'}: 408s assert {}==snapshot({0: 5, 1: 5, 2: 5}) 408s assert {}==snapshot({}) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {}==snapshot({0: 5, 1: 5, 2: 5}) 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_159.py", line 9, in 408s assert {}==snapshot({0: 5, 1: 5, 2: 5}) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_160.py", line 9, in 408s assert {}==snapshot({0: 5, 1: 5, 2: 5}) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s ------------------------------ Captured log call ------------------------------- 408s 408s _________________ test_generic [{0: 5, 1: 5} -> {2: 8} ] __________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_162.py:9: in 408s assert {2: 8}==snapshot({0: 5, 1: 5}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 408s self.context.file._value_to_code(k), 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '2 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_162.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {2: 8}==snapshot({0: 5, 1: 5}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _________ test_generic [{0: 5, 1: 5, 2: 2+2} -> {2: 4} ] __________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_163.py:9: in 408s assert {2: 4}==snapshot({0: 5, 1: 5, 2: 2+2}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_163.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {2: 4}==snapshot({0: 5, 1: 5, 2: 2+2}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [{0: 5, 1: 5, 2: 3} -> {2: 3} ] _______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s s1 = source(code) 408s print("source:", code) 408s 408s assert set(s1.flags) == flags 408s 408s assert ("fix" in flags) == s1.error 408s 408s for f in all_flags: 408s c3 = build( 408s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 408s ) 408s new_code = f"assert {c2}==snapshot({c3})" 408s 408s print(f"{set(f)}:") 408s print(" ", code) 408s print(" ", new_code) 408s > s2 = s1.run(*f) 408s 408s tests/test_preserve_values.py:245: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:137: in run 408s recorder.fix_all() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 408s file.rewrite() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 408s new_code = self.new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 408s format_whole_file = enforce_formatting() or code == format_code( 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s 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})' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_166.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 408s source: assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 408s set(): 408s assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 408s assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 408s {'fix'}: 408s assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 408s assert {2: 3}==snapshot({2: 3}) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_164.py", line 9, in 408s assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_165.py", line 9, in 408s assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s ------------------------------ Captured log call ------------------------------- 408s 408s _________________ test_generic [{0: 5, 2: 5} -> {1: 8} ] __________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_167.py:9: in 408s assert {1: 8}==snapshot({0: 5, 2: 5}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 408s self.context.file._value_to_code(k), 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '1 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_167.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {1: 8}==snapshot({0: 5, 2: 5}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _________________ test_generic [{0: 5} -> {1: 8, 2: 8} ] __________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_168.py:9: in 408s assert {1: 8, 2: 8}==snapshot({0: 5}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 408s self.context.file._value_to_code(k), 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '1 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_168.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {1: 8, 2: 8}==snapshot({0: 5}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _________ test_generic [{0: 5, 2: 2+2} -> {1: 8, 2: 4} ] __________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_169.py:9: in 408s assert {1: 8, 2: 4}==snapshot({0: 5, 2: 2+2}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_169.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {1: 8, 2: 4}==snapshot({0: 5, 2: 2+2}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [{0: 5, 2: 3} -> {1: 8, 2: 3} ] _______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_170.py:9: in 408s assert {1: 8, 2: 3}==snapshot({0: 5, 2: 3}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 408s self.context.file._value_to_code(k), 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '1 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_170.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {1: 8, 2: 3}==snapshot({0: 5, 2: 3}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _________ test_generic [{0: 5, 1: 2+2, 2: 5} -> {1: 4} ] __________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_171.py:9: in 408s assert {1: 4}==snapshot({0: 5, 1: 2+2, 2: 5}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_171.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {1: 4}==snapshot({0: 5, 1: 2+2, 2: 5}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _________ test_generic [{0: 5, 1: 2+2} -> {1: 4, 2: 8} ] __________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_172.py:9: in 408s assert {1: 4, 2: 8}==snapshot({0: 5, 1: 2+2}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_172.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {1: 4, 2: 8}==snapshot({0: 5, 1: 2+2}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____ test_generic [{0: 5, 1: 2+2, 2: 2+2} -> {1: 4, 2: 4} ] ______ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_173.py:9: in 408s assert {1: 4, 2: 4}==snapshot({0: 5, 1: 2+2, 2: 2+2}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_173.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {1: 4, 2: 4}==snapshot({0: 5, 1: 2+2, 2: 2+2}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______ test_generic [{0: 5, 1: 2+2, 2: 3} -> {1: 4, 2: 3} ] _______ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_174.py:9: in 408s assert {1: 4, 2: 3}==snapshot({0: 5, 1: 2+2, 2: 3}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_174.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {1: 4, 2: 3}==snapshot({0: 5, 1: 2+2, 2: 3}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [{0: 5, 1: 3, 2: 5} -> {1: 3} ] _______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s s1 = source(code) 408s print("source:", code) 408s 408s assert set(s1.flags) == flags 408s 408s assert ("fix" in flags) == s1.error 408s 408s for f in all_flags: 408s c3 = build( 408s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 408s ) 408s new_code = f"assert {c2}==snapshot({c3})" 408s 408s print(f"{set(f)}:") 408s print(" ", code) 408s print(" ", new_code) 408s > s2 = s1.run(*f) 408s 408s tests/test_preserve_values.py:245: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:137: in run 408s recorder.fix_all() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 408s file.rewrite() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 408s new_code = self.new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 408s format_whole_file = enforce_formatting() or code == format_code( 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s 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})' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_177.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 408s source: assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 408s set(): 408s assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 408s assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 408s {'fix'}: 408s assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 408s assert {1: 3}==snapshot({1: 3}) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_175.py", line 9, in 408s assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_176.py", line 9, in 408s assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [{0: 5, 1: 3} -> {1: 3, 2: 8} ] _______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_178.py:9: in 408s assert {1: 3, 2: 8}==snapshot({0: 5, 1: 3}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 408s self.context.file._value_to_code(k), 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '2 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_178.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {1: 3, 2: 8}==snapshot({0: 5, 1: 3}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______ test_generic [{0: 5, 1: 3, 2: 2+2} -> {1: 3, 2: 4} ] _______ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_179.py:9: in 408s assert {1: 3, 2: 4}==snapshot({0: 5, 1: 3, 2: 2+2}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_179.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {1: 3, 2: 4}==snapshot({0: 5, 1: 3, 2: 2+2}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ___________ test_generic [{0: 5, 1: 3, 2: 3} -> {1: 3, 2: 3} ] ____________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s s1 = source(code) 408s print("source:", code) 408s 408s assert set(s1.flags) == flags 408s 408s assert ("fix" in flags) == s1.error 408s 408s for f in all_flags: 408s c3 = build( 408s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 408s ) 408s new_code = f"assert {c2}==snapshot({c3})" 408s 408s print(f"{set(f)}:") 408s print(" ", code) 408s print(" ", new_code) 408s > s2 = s1.run(*f) 408s 408s tests/test_preserve_values.py:245: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:137: in run 408s recorder.fix_all() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 408s file.rewrite() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 408s new_code = self.new_code() 408s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 408s format_whole_file = enforce_formatting() or code == format_code( 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s 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})' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_182.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 408s source: assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 408s set(): 408s assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 408s assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 408s reported_flags: {'fix'} 408s run: pytest --inline-snapshot= 408s output: 408s |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 408s {'fix'}: 408s assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 408s assert {1: 3, 2: 3}==snapshot({1: 3, 2: 3}) 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 408s ----------------------------- Captured stderr call ----------------------------- 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_180.py", line 9, in 408s assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s Traceback (most recent call last): 408s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_181.py", line 9, in 408s assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) 408s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 408s AssertionError 408s ------------------------------ Captured log call ------------------------------- 408s 408s _________________ test_generic [{1: 5, 2: 5} -> {0: 8} ] __________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_183.py:9: in 408s assert {0: 8}==snapshot({1: 5, 2: 5}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 408s self.context.file._value_to_code(k), 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '0 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_183.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {0: 8}==snapshot({1: 5, 2: 5}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _________________ test_generic [{1: 5} -> {0: 8, 2: 8} ] __________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_184.py:9: in 408s assert {0: 8, 2: 8}==snapshot({1: 5}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 408s self.context.file._value_to_code(k), 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '0 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_184.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {0: 8, 2: 8}==snapshot({1: 5}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _________ test_generic [{1: 5, 2: 2+2} -> {0: 8, 2: 4} ] __________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_185.py:9: in 408s assert {0: 8, 2: 4}==snapshot({1: 5, 2: 2+2}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_185.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {0: 8, 2: 4}==snapshot({1: 5, 2: 2+2}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [{1: 5, 2: 3} -> {0: 8, 2: 3} ] _______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_186.py:9: in 408s assert {0: 8, 2: 3}==snapshot({1: 5, 2: 3}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 408s self.context.file._value_to_code(k), 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '0 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_186.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {0: 8, 2: 3}==snapshot({1: 5, 2: 3}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _________________ test_generic [{2: 5} -> {0: 8, 1: 8} ] __________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_187.py:9: in 408s assert {0: 8, 1: 8}==snapshot({2: 5}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 408s self.context.file._value_to_code(k), 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '0 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_187.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {0: 8, 1: 8}==snapshot({2: 5}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ________________ test_generic [{} -> {0: 8, 1: 8, 2: 8} ] _________________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_188.py:9: in 408s assert {0: 8, 1: 8, 2: 8}==snapshot({}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 408s self.context.file._value_to_code(k), 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '0 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_188.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {0: 8, 1: 8, 2: 8}==snapshot({}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _________ test_generic [{2: 2+2} -> {0: 8, 1: 8, 2: 4} ] __________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_189.py:9: in 408s assert {0: 8, 1: 8, 2: 4}==snapshot({2: 2+2}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_189.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {0: 8, 1: 8, 2: 4}==snapshot({2: 2+2}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [{2: 3} -> {0: 8, 1: 8, 2: 3} ] _______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_190.py:9: in 408s assert {0: 8, 1: 8, 2: 3}==snapshot({2: 3}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 408s self.context.file._value_to_code(k), 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '0 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_190.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {0: 8, 1: 8, 2: 3}==snapshot({2: 3}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _________ test_generic [{1: 2+2, 2: 5} -> {0: 8, 1: 4} ] __________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_191.py:9: in 408s assert {0: 8, 1: 4}==snapshot({1: 2+2, 2: 5}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_191.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {0: 8, 1: 4}==snapshot({1: 2+2, 2: 5}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _________ test_generic [{1: 2+2} -> {0: 8, 1: 4, 2: 8} ] __________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_192.py:9: in 408s assert {0: 8, 1: 4, 2: 8}==snapshot({1: 2+2}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_192.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {0: 8, 1: 4, 2: 8}==snapshot({1: 2+2}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____ test_generic [{1: 2+2, 2: 2+2} -> {0: 8, 1: 4, 2: 4} ] ______ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_193.py:9: in 408s assert {0: 8, 1: 4, 2: 4}==snapshot({1: 2+2, 2: 2+2}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_193.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {0: 8, 1: 4, 2: 4}==snapshot({1: 2+2, 2: 2+2}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______ test_generic [{1: 2+2, 2: 3} -> {0: 8, 1: 4, 2: 3} ] _______ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_194.py:9: in 408s assert {0: 8, 1: 4, 2: 3}==snapshot({1: 2+2, 2: 3}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_194.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {0: 8, 1: 4, 2: 3}==snapshot({1: 2+2, 2: 3}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [{1: 3, 2: 5} -> {0: 8, 1: 3} ] _______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_195.py:9: in 408s assert {0: 8, 1: 3}==snapshot({1: 3, 2: 5}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 408s self.context.file._value_to_code(k), 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '0 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_195.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {0: 8, 1: 3}==snapshot({1: 3, 2: 5}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______________ test_generic [{1: 3} -> {0: 8, 1: 3, 2: 8} ] _______________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_196.py:9: in 408s assert {0: 8, 1: 3, 2: 8}==snapshot({1: 3}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 408s self.context.file._value_to_code(k), 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '0 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_196.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {0: 8, 1: 3, 2: 8}==snapshot({1: 3}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______ test_generic [{1: 3, 2: 2+2} -> {0: 8, 1: 3, 2: 4} ] _______ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_197.py:9: in 408s assert {0: 8, 1: 3, 2: 4}==snapshot({1: 3, 2: 2+2}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 408s self.context.file._value_to_code(k), 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '0 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_197.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {0: 8, 1: 3, 2: 4}==snapshot({1: 3, 2: 2+2}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ___________ test_generic [{1: 3, 2: 3} -> {0: 8, 1: 3, 2: 3} ] ____________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_198.py:9: in 408s assert {0: 8, 1: 3, 2: 3}==snapshot({1: 3, 2: 3}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 408s self.context.file._value_to_code(k), 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 408s return self._token_to_code(value_to_token(value)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '0 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_198.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {0: 8, 1: 3, 2: 3}==snapshot({1: 3, 2: 3}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _________ test_generic [{0: 2+2, 1: 5, 2: 5} -> {0: 4} ] __________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_199.py:9: in 408s assert {0: 4}==snapshot({0: 2+2, 1: 5, 2: 5}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_199.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {0: 4}==snapshot({0: 2+2, 1: 5, 2: 5}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _________ test_generic [{0: 2+2, 1: 5} -> {0: 4, 2: 8} ] __________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_200.py:9: in 408s assert {0: 4, 2: 8}==snapshot({0: 2+2, 1: 5}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_200.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {0: 4, 2: 8}==snapshot({0: 2+2, 1: 5}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____ test_generic [{0: 2+2, 1: 5, 2: 2+2} -> {0: 4, 2: 4} ] ______ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_201.py:9: in 408s assert {0: 4, 2: 4}==snapshot({0: 2+2, 1: 5, 2: 2+2}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_201.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {0: 4, 2: 4}==snapshot({0: 2+2, 1: 5, 2: 2+2}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______ test_generic [{0: 2+2, 1: 5, 2: 3} -> {0: 4, 2: 3} ] _______ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_202.py:9: in 408s assert {0: 4, 2: 3}==snapshot({0: 2+2, 1: 5, 2: 3}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_202.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {0: 4, 2: 3}==snapshot({0: 2+2, 1: 5, 2: 3}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _________ test_generic [{0: 2+2, 2: 5} -> {0: 4, 1: 8} ] __________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_203.py:9: in 408s assert {0: 4, 1: 8}==snapshot({0: 2+2, 2: 5}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_203.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {0: 4, 1: 8}==snapshot({0: 2+2, 2: 5}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _________ test_generic [{0: 2+2} -> {0: 4, 1: 8, 2: 8} ] __________ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_204.py:9: in 408s assert {0: 4, 1: 8, 2: 8}==snapshot({0: 2+2}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_204.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {0: 4, 1: 8, 2: 8}==snapshot({0: 2+2}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s _____ test_generic [{0: 2+2, 2: 2+2} -> {0: 4, 1: 8, 2: 4} ] ______ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_205.py:9: in 408s assert {0: 4, 1: 8, 2: 4}==snapshot({0: 2+2, 2: 2+2}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_205.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 408s f"""\ 408s [b]inline-snapshot is not able to format your code.[/b] 408s This issue can be solved by: 408s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 408s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 408s """ 408s ) 408s return text 408s 408s with warnings.catch_warnings(): 408s warnings.simplefilter("ignore") 408s 408s > runner = CliRunner(mix_stderr=False) 408s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 408s 408s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 408s ----------------------------- Captured stdout call ----------------------------- 408s 408s input: 408s |""" 408s |PYTEST_DONT_REWRITE 408s |""" 408s |# äöß 🐍 408s |from inline_snapshot import snapshot 408s |from inline_snapshot import external 408s |from inline_snapshot import outsource 408s | 408s |assert {0: 4, 1: 8, 2: 4}==snapshot({0: 2+2, 2: 2+2}) 408s ------------------------------ Captured log call ------------------------------- 408s 408s ______ test_generic [{0: 2+2, 2: 3} -> {0: 4, 1: 8, 2: 3} ] _______ 408s 408s source = .w at 0xf2dee848> 408s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 408s 408s def test_generic(source, subtests): 408s for braces in ("[]", "()", "{}"): 408s for value_specs in itertools.product(stuff, repeat=3): 408s flags = set().union(*[e[3] for e in value_specs]) 408s all_flags = { 408s frozenset(x) - {""} 408s for x in itertools.combinations_with_replacement( 408s flags | {""}, len(flags) 408s ) 408s } 408s 408s def build(value_lists): 408s value_lists = list(value_lists) 408s 408s if braces == "{}": 408s values = [ 408s f"{i}: {value_list[0]}" 408s for i, value_list in enumerate(value_lists) 408s if value_list 408s ] 408s else: 408s values = [x for value_list in value_lists for x in value_list] 408s 408s code = ", ".join(values) 408s 408s comma = "" 408s if len(values) == 1 and braces == "()": 408s comma = "," 408s 408s return f"{braces[0]}{code}{comma}{braces[1]}" 408s 408s c1 = build(spec[0] for spec in value_specs) 408s c2 = build(spec[1] for spec in value_specs) 408s code = f"assert {c2}==snapshot({c1})" 408s 408s named_flags = ", ".join(flags) 408s 408s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 408s > s1 = source(code) 408s 408s tests/test_preserve_values.py:229: 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s tests/conftest.py:158: in w 408s return Source(source=source).run() 408s tests/conftest.py:114: in run 408s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 408s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_206.py:9: in 408s assert {0: 4, 1: 8, 2: 3}==snapshot({0: 2+2, 2: 3}) 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 408s return self == other 408s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 408s self._changes.append(next(it)) 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 408s result[key] = yield from self.get_adapter( 408s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 408s new_code = self.context.file._token_to_code(new_token) 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 408s return self._format(tokenize.untokenize(tokens)).strip() 408s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 408s return format_code(text, Path(self._source.filename)) 408s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 408s 408s text = '4 ' 408s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_206.py') 408s 408s def format_code(text, filename): 408s if _config.config.format_command is not None: 408s format_command = _config.config.format_command.format(filename=filename) 408s result = sp.run( 408s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 408s ) 408s if result.returncode != 0: 408s raise_problem( 408s f"""\ 408s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 408s """ 408s + result.stdout.decode("utf-8") 408s + result.stderr.decode("utf-8") 408s ) 408s return text 408s return result.stdout.decode("utf-8") 408s 408s try: 408s from black import main 408s from click.testing import CliRunner 408s except ImportError: 408s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 4, 1: 8, 2: 3}==snapshot({0: 2+2, 2: 3}) 409s ------------------------------ Captured log call ------------------------------- 409s 409s _____ test_generic [{0: 2+2, 1: 2+2, 2: 5} -> {0: 4, 1: 4} ] ______ 409s 409s source = .w at 0xf2dee848> 409s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 409s 409s def test_generic(source, subtests): 409s for braces in ("[]", "()", "{}"): 409s for value_specs in itertools.product(stuff, repeat=3): 409s flags = set().union(*[e[3] for e in value_specs]) 409s all_flags = { 409s frozenset(x) - {""} 409s for x in itertools.combinations_with_replacement( 409s flags | {""}, len(flags) 409s ) 409s } 409s 409s def build(value_lists): 409s value_lists = list(value_lists) 409s 409s if braces == "{}": 409s values = [ 409s f"{i}: {value_list[0]}" 409s for i, value_list in enumerate(value_lists) 409s if value_list 409s ] 409s else: 409s values = [x for value_list in value_lists for x in value_list] 409s 409s code = ", ".join(values) 409s 409s comma = "" 409s if len(values) == 1 and braces == "()": 409s comma = "," 409s 409s return f"{braces[0]}{code}{comma}{braces[1]}" 409s 409s c1 = build(spec[0] for spec in value_specs) 409s c2 = build(spec[1] for spec in value_specs) 409s code = f"assert {c2}==snapshot({c1})" 409s 409s named_flags = ", ".join(flags) 409s 409s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 409s > s1 = source(code) 409s 409s tests/test_preserve_values.py:229: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s tests/conftest.py:158: in w 409s return Source(source=source).run() 409s tests/conftest.py:114: in run 409s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 409s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_207.py:9: in 409s assert {0: 4, 1: 4}==snapshot({0: 2+2, 1: 2+2, 2: 5}) 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 409s result[key] = yield from self.get_adapter( 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '4 ' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_207.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 4, 1: 4}==snapshot({0: 2+2, 1: 2+2, 2: 5}) 409s ------------------------------ Captured log call ------------------------------- 409s 409s _____ test_generic [{0: 2+2, 1: 2+2} -> {0: 4, 1: 4, 2: 8} ] ______ 409s 409s source = .w at 0xf2dee848> 409s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 409s 409s def test_generic(source, subtests): 409s for braces in ("[]", "()", "{}"): 409s for value_specs in itertools.product(stuff, repeat=3): 409s flags = set().union(*[e[3] for e in value_specs]) 409s all_flags = { 409s frozenset(x) - {""} 409s for x in itertools.combinations_with_replacement( 409s flags | {""}, len(flags) 409s ) 409s } 409s 409s def build(value_lists): 409s value_lists = list(value_lists) 409s 409s if braces == "{}": 409s values = [ 409s f"{i}: {value_list[0]}" 409s for i, value_list in enumerate(value_lists) 409s if value_list 409s ] 409s else: 409s values = [x for value_list in value_lists for x in value_list] 409s 409s code = ", ".join(values) 409s 409s comma = "" 409s if len(values) == 1 and braces == "()": 409s comma = "," 409s 409s return f"{braces[0]}{code}{comma}{braces[1]}" 409s 409s c1 = build(spec[0] for spec in value_specs) 409s c2 = build(spec[1] for spec in value_specs) 409s code = f"assert {c2}==snapshot({c1})" 409s 409s named_flags = ", ".join(flags) 409s 409s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 409s > s1 = source(code) 409s 409s tests/test_preserve_values.py:229: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s tests/conftest.py:158: in w 409s return Source(source=source).run() 409s tests/conftest.py:114: in run 409s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 409s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_208.py:9: in 409s assert {0: 4, 1: 4, 2: 8}==snapshot({0: 2+2, 1: 2+2}) 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 409s result[key] = yield from self.get_adapter( 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '4 ' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_208.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 4, 1: 4, 2: 8}==snapshot({0: 2+2, 1: 2+2}) 409s ------------------------------ Captured log call ------------------------------- 409s 409s ____ test_generic [{0: 2+2, 1: 2+2, 2: 2+2} -> {0: 4, 1: 4, 2: 4} ] ____ 409s 409s source = .w at 0xf2dee848> 409s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 409s 409s def test_generic(source, subtests): 409s for braces in ("[]", "()", "{}"): 409s for value_specs in itertools.product(stuff, repeat=3): 409s flags = set().union(*[e[3] for e in value_specs]) 409s all_flags = { 409s frozenset(x) - {""} 409s for x in itertools.combinations_with_replacement( 409s flags | {""}, len(flags) 409s ) 409s } 409s 409s def build(value_lists): 409s value_lists = list(value_lists) 409s 409s if braces == "{}": 409s values = [ 409s f"{i}: {value_list[0]}" 409s for i, value_list in enumerate(value_lists) 409s if value_list 409s ] 409s else: 409s values = [x for value_list in value_lists for x in value_list] 409s 409s code = ", ".join(values) 409s 409s comma = "" 409s if len(values) == 1 and braces == "()": 409s comma = "," 409s 409s return f"{braces[0]}{code}{comma}{braces[1]}" 409s 409s c1 = build(spec[0] for spec in value_specs) 409s c2 = build(spec[1] for spec in value_specs) 409s code = f"assert {c2}==snapshot({c1})" 409s 409s named_flags = ", ".join(flags) 409s 409s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 409s > s1 = source(code) 409s 409s tests/test_preserve_values.py:229: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s tests/conftest.py:158: in w 409s return Source(source=source).run() 409s tests/conftest.py:114: in run 409s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 409s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_209.py:9: in 409s assert {0: 4, 1: 4, 2: 4}==snapshot({0: 2+2, 1: 2+2, 2: 2+2}) 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 409s result[key] = yield from self.get_adapter( 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '4 ' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_209.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 4, 1: 4, 2: 4}==snapshot({0: 2+2, 1: 2+2, 2: 2+2}) 409s ------------------------------ Captured log call ------------------------------- 409s 409s _____ test_generic [{0: 2+2, 1: 2+2, 2: 3} -> {0: 4, 1: 4, 2: 3} ] _____ 409s 409s source = .w at 0xf2dee848> 409s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 409s 409s def test_generic(source, subtests): 409s for braces in ("[]", "()", "{}"): 409s for value_specs in itertools.product(stuff, repeat=3): 409s flags = set().union(*[e[3] for e in value_specs]) 409s all_flags = { 409s frozenset(x) - {""} 409s for x in itertools.combinations_with_replacement( 409s flags | {""}, len(flags) 409s ) 409s } 409s 409s def build(value_lists): 409s value_lists = list(value_lists) 409s 409s if braces == "{}": 409s values = [ 409s f"{i}: {value_list[0]}" 409s for i, value_list in enumerate(value_lists) 409s if value_list 409s ] 409s else: 409s values = [x for value_list in value_lists for x in value_list] 409s 409s code = ", ".join(values) 409s 409s comma = "" 409s if len(values) == 1 and braces == "()": 409s comma = "," 409s 409s return f"{braces[0]}{code}{comma}{braces[1]}" 409s 409s c1 = build(spec[0] for spec in value_specs) 409s c2 = build(spec[1] for spec in value_specs) 409s code = f"assert {c2}==snapshot({c1})" 409s 409s named_flags = ", ".join(flags) 409s 409s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 409s > s1 = source(code) 409s 409s tests/test_preserve_values.py:229: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s tests/conftest.py:158: in w 409s return Source(source=source).run() 409s tests/conftest.py:114: in run 409s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 409s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_210.py:9: in 409s assert {0: 4, 1: 4, 2: 3}==snapshot({0: 2+2, 1: 2+2, 2: 3}) 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 409s result[key] = yield from self.get_adapter( 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '4 ' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_210.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 4, 1: 4, 2: 3}==snapshot({0: 2+2, 1: 2+2, 2: 3}) 409s ------------------------------ Captured log call ------------------------------- 409s 409s ______ test_generic [{0: 2+2, 1: 3, 2: 5} -> {0: 4, 1: 3} ] _______ 409s 409s source = .w at 0xf2dee848> 409s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 409s 409s def test_generic(source, subtests): 409s for braces in ("[]", "()", "{}"): 409s for value_specs in itertools.product(stuff, repeat=3): 409s flags = set().union(*[e[3] for e in value_specs]) 409s all_flags = { 409s frozenset(x) - {""} 409s for x in itertools.combinations_with_replacement( 409s flags | {""}, len(flags) 409s ) 409s } 409s 409s def build(value_lists): 409s value_lists = list(value_lists) 409s 409s if braces == "{}": 409s values = [ 409s f"{i}: {value_list[0]}" 409s for i, value_list in enumerate(value_lists) 409s if value_list 409s ] 409s else: 409s values = [x for value_list in value_lists for x in value_list] 409s 409s code = ", ".join(values) 409s 409s comma = "" 409s if len(values) == 1 and braces == "()": 409s comma = "," 409s 409s return f"{braces[0]}{code}{comma}{braces[1]}" 409s 409s c1 = build(spec[0] for spec in value_specs) 409s c2 = build(spec[1] for spec in value_specs) 409s code = f"assert {c2}==snapshot({c1})" 409s 409s named_flags = ", ".join(flags) 409s 409s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 409s > s1 = source(code) 409s 409s tests/test_preserve_values.py:229: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s tests/conftest.py:158: in w 409s return Source(source=source).run() 409s tests/conftest.py:114: in run 409s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 409s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_211.py:9: in 409s assert {0: 4, 1: 3}==snapshot({0: 2+2, 1: 3, 2: 5}) 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 409s result[key] = yield from self.get_adapter( 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '4 ' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_211.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 4, 1: 3}==snapshot({0: 2+2, 1: 3, 2: 5}) 409s ------------------------------ Captured log call ------------------------------- 409s 409s ______ test_generic [{0: 2+2, 1: 3} -> {0: 4, 1: 3, 2: 8} ] _______ 409s 409s source = .w at 0xf2dee848> 409s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 409s 409s def test_generic(source, subtests): 409s for braces in ("[]", "()", "{}"): 409s for value_specs in itertools.product(stuff, repeat=3): 409s flags = set().union(*[e[3] for e in value_specs]) 409s all_flags = { 409s frozenset(x) - {""} 409s for x in itertools.combinations_with_replacement( 409s flags | {""}, len(flags) 409s ) 409s } 409s 409s def build(value_lists): 409s value_lists = list(value_lists) 409s 409s if braces == "{}": 409s values = [ 409s f"{i}: {value_list[0]}" 409s for i, value_list in enumerate(value_lists) 409s if value_list 409s ] 409s else: 409s values = [x for value_list in value_lists for x in value_list] 409s 409s code = ", ".join(values) 409s 409s comma = "" 409s if len(values) == 1 and braces == "()": 409s comma = "," 409s 409s return f"{braces[0]}{code}{comma}{braces[1]}" 409s 409s c1 = build(spec[0] for spec in value_specs) 409s c2 = build(spec[1] for spec in value_specs) 409s code = f"assert {c2}==snapshot({c1})" 409s 409s named_flags = ", ".join(flags) 409s 409s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 409s > s1 = source(code) 409s 409s tests/test_preserve_values.py:229: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s tests/conftest.py:158: in w 409s return Source(source=source).run() 409s tests/conftest.py:114: in run 409s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 409s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_212.py:9: in 409s assert {0: 4, 1: 3, 2: 8}==snapshot({0: 2+2, 1: 3}) 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 409s result[key] = yield from self.get_adapter( 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '4 ' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_212.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 4, 1: 3, 2: 8}==snapshot({0: 2+2, 1: 3}) 409s ------------------------------ Captured log call ------------------------------- 409s 409s _____ test_generic [{0: 2+2, 1: 3, 2: 2+2} -> {0: 4, 1: 3, 2: 4} ] _____ 409s 409s source = .w at 0xf2dee848> 409s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 409s 409s def test_generic(source, subtests): 409s for braces in ("[]", "()", "{}"): 409s for value_specs in itertools.product(stuff, repeat=3): 409s flags = set().union(*[e[3] for e in value_specs]) 409s all_flags = { 409s frozenset(x) - {""} 409s for x in itertools.combinations_with_replacement( 409s flags | {""}, len(flags) 409s ) 409s } 409s 409s def build(value_lists): 409s value_lists = list(value_lists) 409s 409s if braces == "{}": 409s values = [ 409s f"{i}: {value_list[0]}" 409s for i, value_list in enumerate(value_lists) 409s if value_list 409s ] 409s else: 409s values = [x for value_list in value_lists for x in value_list] 409s 409s code = ", ".join(values) 409s 409s comma = "" 409s if len(values) == 1 and braces == "()": 409s comma = "," 409s 409s return f"{braces[0]}{code}{comma}{braces[1]}" 409s 409s c1 = build(spec[0] for spec in value_specs) 409s c2 = build(spec[1] for spec in value_specs) 409s code = f"assert {c2}==snapshot({c1})" 409s 409s named_flags = ", ".join(flags) 409s 409s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 409s > s1 = source(code) 409s 409s tests/test_preserve_values.py:229: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s tests/conftest.py:158: in w 409s return Source(source=source).run() 409s tests/conftest.py:114: in run 409s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 409s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_213.py:9: in 409s assert {0: 4, 1: 3, 2: 4}==snapshot({0: 2+2, 1: 3, 2: 2+2}) 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 409s result[key] = yield from self.get_adapter( 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '4 ' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_213.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 4, 1: 3, 2: 4}==snapshot({0: 2+2, 1: 3, 2: 2+2}) 409s ------------------------------ Captured log call ------------------------------- 409s 409s ______ test_generic [{0: 2+2, 1: 3, 2: 3} -> {0: 4, 1: 3, 2: 3} ] ______ 409s 409s source = .w at 0xf2dee848> 409s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 409s 409s def test_generic(source, subtests): 409s for braces in ("[]", "()", "{}"): 409s for value_specs in itertools.product(stuff, repeat=3): 409s flags = set().union(*[e[3] for e in value_specs]) 409s all_flags = { 409s frozenset(x) - {""} 409s for x in itertools.combinations_with_replacement( 409s flags | {""}, len(flags) 409s ) 409s } 409s 409s def build(value_lists): 409s value_lists = list(value_lists) 409s 409s if braces == "{}": 409s values = [ 409s f"{i}: {value_list[0]}" 409s for i, value_list in enumerate(value_lists) 409s if value_list 409s ] 409s else: 409s values = [x for value_list in value_lists for x in value_list] 409s 409s code = ", ".join(values) 409s 409s comma = "" 409s if len(values) == 1 and braces == "()": 409s comma = "," 409s 409s return f"{braces[0]}{code}{comma}{braces[1]}" 409s 409s c1 = build(spec[0] for spec in value_specs) 409s c2 = build(spec[1] for spec in value_specs) 409s code = f"assert {c2}==snapshot({c1})" 409s 409s named_flags = ", ".join(flags) 409s 409s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 409s > s1 = source(code) 409s 409s tests/test_preserve_values.py:229: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s tests/conftest.py:158: in w 409s return Source(source=source).run() 409s tests/conftest.py:114: in run 409s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 409s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_214.py:9: in 409s assert {0: 4, 1: 3, 2: 3}==snapshot({0: 2+2, 1: 3, 2: 3}) 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 409s result[key] = yield from self.get_adapter( 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '4 ' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_214.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 4, 1: 3, 2: 3}==snapshot({0: 2+2, 1: 3, 2: 3}) 409s ------------------------------ Captured log call ------------------------------- 409s 409s ______________ test_generic [{0: 3, 1: 5, 2: 5} -> {0: 3} ] _______________ 409s 409s source = .w at 0xf2dee848> 409s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 409s 409s def test_generic(source, subtests): 409s for braces in ("[]", "()", "{}"): 409s for value_specs in itertools.product(stuff, repeat=3): 409s flags = set().union(*[e[3] for e in value_specs]) 409s all_flags = { 409s frozenset(x) - {""} 409s for x in itertools.combinations_with_replacement( 409s flags | {""}, len(flags) 409s ) 409s } 409s 409s def build(value_lists): 409s value_lists = list(value_lists) 409s 409s if braces == "{}": 409s values = [ 409s f"{i}: {value_list[0]}" 409s for i, value_list in enumerate(value_lists) 409s if value_list 409s ] 409s else: 409s values = [x for value_list in value_lists for x in value_list] 409s 409s code = ", ".join(values) 409s 409s comma = "" 409s if len(values) == 1 and braces == "()": 409s comma = "," 409s 409s return f"{braces[0]}{code}{comma}{braces[1]}" 409s 409s c1 = build(spec[0] for spec in value_specs) 409s c2 = build(spec[1] for spec in value_specs) 409s code = f"assert {c2}==snapshot({c1})" 409s 409s named_flags = ", ".join(flags) 409s 409s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 409s s1 = source(code) 409s print("source:", code) 409s 409s assert set(s1.flags) == flags 409s 409s assert ("fix" in flags) == s1.error 409s 409s for f in all_flags: 409s c3 = build( 409s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 409s ) 409s new_code = f"assert {c2}==snapshot({c3})" 409s 409s print(f"{set(f)}:") 409s print(" ", code) 409s print(" ", new_code) 409s > s2 = s1.run(*f) 409s 409s tests/test_preserve_values.py:245: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s tests/conftest.py:137: in run 409s recorder.fix_all() 409s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 409s file.rewrite() 409s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 409s new_code = self.new_code() 409s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 409s format_whole_file = enforce_formatting() or code == format_code( 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s 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})' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_217.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 409s reported_flags: {'fix'} 409s run: pytest --inline-snapshot= 409s output: 409s |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 409s source: assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 409s set(): 409s assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 409s assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 409s reported_flags: {'fix'} 409s run: pytest --inline-snapshot= 409s output: 409s |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 409s {'fix'}: 409s assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 409s assert {0: 3}==snapshot({0: 3}) 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 409s ----------------------------- Captured stderr call ----------------------------- 409s Traceback (most recent call last): 409s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 409s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 409s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_215.py", line 9, in 409s assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 409s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 409s AssertionError 409s Traceback (most recent call last): 409s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 409s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 409s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_216.py", line 9, in 409s assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) 409s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 409s AssertionError 409s ------------------------------ Captured log call ------------------------------- 409s 409s ______________ test_generic [{0: 3, 1: 5} -> {0: 3, 2: 8} ] _______________ 409s 409s source = .w at 0xf2dee848> 409s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 409s 409s def test_generic(source, subtests): 409s for braces in ("[]", "()", "{}"): 409s for value_specs in itertools.product(stuff, repeat=3): 409s flags = set().union(*[e[3] for e in value_specs]) 409s all_flags = { 409s frozenset(x) - {""} 409s for x in itertools.combinations_with_replacement( 409s flags | {""}, len(flags) 409s ) 409s } 409s 409s def build(value_lists): 409s value_lists = list(value_lists) 409s 409s if braces == "{}": 409s values = [ 409s f"{i}: {value_list[0]}" 409s for i, value_list in enumerate(value_lists) 409s if value_list 409s ] 409s else: 409s values = [x for value_list in value_lists for x in value_list] 409s 409s code = ", ".join(values) 409s 409s comma = "" 409s if len(values) == 1 and braces == "()": 409s comma = "," 409s 409s return f"{braces[0]}{code}{comma}{braces[1]}" 409s 409s c1 = build(spec[0] for spec in value_specs) 409s c2 = build(spec[1] for spec in value_specs) 409s code = f"assert {c2}==snapshot({c1})" 409s 409s named_flags = ", ".join(flags) 409s 409s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 409s > s1 = source(code) 409s 409s tests/test_preserve_values.py:229: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s tests/conftest.py:158: in w 409s return Source(source=source).run() 409s tests/conftest.py:114: in run 409s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 409s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_218.py:9: in 409s assert {0: 3, 2: 8}==snapshot({0: 3, 1: 5}) 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 409s self.context.file._value_to_code(k), 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 409s return self._token_to_code(value_to_token(value)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '2 ' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_218.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 3, 2: 8}==snapshot({0: 3, 1: 5}) 409s ------------------------------ Captured log call ------------------------------- 409s 409s ______ test_generic [{0: 3, 1: 5, 2: 2+2} -> {0: 3, 2: 4} ] _______ 409s 409s source = .w at 0xf2dee848> 409s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 409s 409s def test_generic(source, subtests): 409s for braces in ("[]", "()", "{}"): 409s for value_specs in itertools.product(stuff, repeat=3): 409s flags = set().union(*[e[3] for e in value_specs]) 409s all_flags = { 409s frozenset(x) - {""} 409s for x in itertools.combinations_with_replacement( 409s flags | {""}, len(flags) 409s ) 409s } 409s 409s def build(value_lists): 409s value_lists = list(value_lists) 409s 409s if braces == "{}": 409s values = [ 409s f"{i}: {value_list[0]}" 409s for i, value_list in enumerate(value_lists) 409s if value_list 409s ] 409s else: 409s values = [x for value_list in value_lists for x in value_list] 409s 409s code = ", ".join(values) 409s 409s comma = "" 409s if len(values) == 1 and braces == "()": 409s comma = "," 409s 409s return f"{braces[0]}{code}{comma}{braces[1]}" 409s 409s c1 = build(spec[0] for spec in value_specs) 409s c2 = build(spec[1] for spec in value_specs) 409s code = f"assert {c2}==snapshot({c1})" 409s 409s named_flags = ", ".join(flags) 409s 409s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 409s > s1 = source(code) 409s 409s tests/test_preserve_values.py:229: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s tests/conftest.py:158: in w 409s return Source(source=source).run() 409s tests/conftest.py:114: in run 409s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 409s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_219.py:9: in 409s assert {0: 3, 2: 4}==snapshot({0: 3, 1: 5, 2: 2+2}) 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 409s result[key] = yield from self.get_adapter( 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '4 ' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_219.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 3, 2: 4}==snapshot({0: 3, 1: 5, 2: 2+2}) 409s ------------------------------ Captured log call ------------------------------- 409s 409s ___________ test_generic [{0: 3, 1: 5, 2: 3} -> {0: 3, 2: 3} ] ____________ 409s 409s source = .w at 0xf2dee848> 409s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 409s 409s def test_generic(source, subtests): 409s for braces in ("[]", "()", "{}"): 409s for value_specs in itertools.product(stuff, repeat=3): 409s flags = set().union(*[e[3] for e in value_specs]) 409s all_flags = { 409s frozenset(x) - {""} 409s for x in itertools.combinations_with_replacement( 409s flags | {""}, len(flags) 409s ) 409s } 409s 409s def build(value_lists): 409s value_lists = list(value_lists) 409s 409s if braces == "{}": 409s values = [ 409s f"{i}: {value_list[0]}" 409s for i, value_list in enumerate(value_lists) 409s if value_list 409s ] 409s else: 409s values = [x for value_list in value_lists for x in value_list] 409s 409s code = ", ".join(values) 409s 409s comma = "" 409s if len(values) == 1 and braces == "()": 409s comma = "," 409s 409s return f"{braces[0]}{code}{comma}{braces[1]}" 409s 409s c1 = build(spec[0] for spec in value_specs) 409s c2 = build(spec[1] for spec in value_specs) 409s code = f"assert {c2}==snapshot({c1})" 409s 409s named_flags = ", ".join(flags) 409s 409s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 409s s1 = source(code) 409s print("source:", code) 409s 409s assert set(s1.flags) == flags 409s 409s assert ("fix" in flags) == s1.error 409s 409s for f in all_flags: 409s c3 = build( 409s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 409s ) 409s new_code = f"assert {c2}==snapshot({c3})" 409s 409s print(f"{set(f)}:") 409s print(" ", code) 409s print(" ", new_code) 409s > s2 = s1.run(*f) 409s 409s tests/test_preserve_values.py:245: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s tests/conftest.py:137: in run 409s recorder.fix_all() 409s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 409s file.rewrite() 409s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 409s new_code = self.new_code() 409s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 409s format_whole_file = enforce_formatting() or code == format_code( 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s 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})' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_222.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 409s reported_flags: {'fix'} 409s run: pytest --inline-snapshot= 409s output: 409s |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 409s source: assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 409s set(): 409s assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 409s assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 409s reported_flags: {'fix'} 409s run: pytest --inline-snapshot= 409s output: 409s |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 409s {'fix'}: 409s assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 409s assert {0: 3, 2: 3}==snapshot({0: 3, 2: 3}) 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 409s ----------------------------- Captured stderr call ----------------------------- 409s Traceback (most recent call last): 409s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 409s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 409s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_220.py", line 9, in 409s assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 409s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 409s AssertionError 409s Traceback (most recent call last): 409s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 409s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 409s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_221.py", line 9, in 409s assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) 409s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 409s AssertionError 409s ------------------------------ Captured log call ------------------------------- 409s 409s ______________ test_generic [{0: 3, 2: 5} -> {0: 3, 1: 8} ] _______________ 409s 409s source = .w at 0xf2dee848> 409s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 409s 409s def test_generic(source, subtests): 409s for braces in ("[]", "()", "{}"): 409s for value_specs in itertools.product(stuff, repeat=3): 409s flags = set().union(*[e[3] for e in value_specs]) 409s all_flags = { 409s frozenset(x) - {""} 409s for x in itertools.combinations_with_replacement( 409s flags | {""}, len(flags) 409s ) 409s } 409s 409s def build(value_lists): 409s value_lists = list(value_lists) 409s 409s if braces == "{}": 409s values = [ 409s f"{i}: {value_list[0]}" 409s for i, value_list in enumerate(value_lists) 409s if value_list 409s ] 409s else: 409s values = [x for value_list in value_lists for x in value_list] 409s 409s code = ", ".join(values) 409s 409s comma = "" 409s if len(values) == 1 and braces == "()": 409s comma = "," 409s 409s return f"{braces[0]}{code}{comma}{braces[1]}" 409s 409s c1 = build(spec[0] for spec in value_specs) 409s c2 = build(spec[1] for spec in value_specs) 409s code = f"assert {c2}==snapshot({c1})" 409s 409s named_flags = ", ".join(flags) 409s 409s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 409s > s1 = source(code) 409s 409s tests/test_preserve_values.py:229: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s tests/conftest.py:158: in w 409s return Source(source=source).run() 409s tests/conftest.py:114: in run 409s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 409s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_223.py:9: in 409s assert {0: 3, 1: 8}==snapshot({0: 3, 2: 5}) 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 409s self.context.file._value_to_code(k), 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 409s return self._token_to_code(value_to_token(value)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '1 ' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_223.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 3, 1: 8}==snapshot({0: 3, 2: 5}) 409s ------------------------------ Captured log call ------------------------------- 409s 409s ______________ test_generic [{0: 3} -> {0: 3, 1: 8, 2: 8} ] _______________ 409s 409s source = .w at 0xf2dee848> 409s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 409s 409s def test_generic(source, subtests): 409s for braces in ("[]", "()", "{}"): 409s for value_specs in itertools.product(stuff, repeat=3): 409s flags = set().union(*[e[3] for e in value_specs]) 409s all_flags = { 409s frozenset(x) - {""} 409s for x in itertools.combinations_with_replacement( 409s flags | {""}, len(flags) 409s ) 409s } 409s 409s def build(value_lists): 409s value_lists = list(value_lists) 409s 409s if braces == "{}": 409s values = [ 409s f"{i}: {value_list[0]}" 409s for i, value_list in enumerate(value_lists) 409s if value_list 409s ] 409s else: 409s values = [x for value_list in value_lists for x in value_list] 409s 409s code = ", ".join(values) 409s 409s comma = "" 409s if len(values) == 1 and braces == "()": 409s comma = "," 409s 409s return f"{braces[0]}{code}{comma}{braces[1]}" 409s 409s c1 = build(spec[0] for spec in value_specs) 409s c2 = build(spec[1] for spec in value_specs) 409s code = f"assert {c2}==snapshot({c1})" 409s 409s named_flags = ", ".join(flags) 409s 409s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 409s > s1 = source(code) 409s 409s tests/test_preserve_values.py:229: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s tests/conftest.py:158: in w 409s return Source(source=source).run() 409s tests/conftest.py:114: in run 409s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 409s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_224.py:9: in 409s assert {0: 3, 1: 8, 2: 8}==snapshot({0: 3}) 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 409s self.context.file._value_to_code(k), 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 409s return self._token_to_code(value_to_token(value)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '1 ' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_224.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 3, 1: 8, 2: 8}==snapshot({0: 3}) 409s ------------------------------ Captured log call ------------------------------- 409s 409s ______ test_generic [{0: 3, 2: 2+2} -> {0: 3, 1: 8, 2: 4} ] _______ 409s 409s source = .w at 0xf2dee848> 409s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 409s 409s def test_generic(source, subtests): 409s for braces in ("[]", "()", "{}"): 409s for value_specs in itertools.product(stuff, repeat=3): 409s flags = set().union(*[e[3] for e in value_specs]) 409s all_flags = { 409s frozenset(x) - {""} 409s for x in itertools.combinations_with_replacement( 409s flags | {""}, len(flags) 409s ) 409s } 409s 409s def build(value_lists): 409s value_lists = list(value_lists) 409s 409s if braces == "{}": 409s values = [ 409s f"{i}: {value_list[0]}" 409s for i, value_list in enumerate(value_lists) 409s if value_list 409s ] 409s else: 409s values = [x for value_list in value_lists for x in value_list] 409s 409s code = ", ".join(values) 409s 409s comma = "" 409s if len(values) == 1 and braces == "()": 409s comma = "," 409s 409s return f"{braces[0]}{code}{comma}{braces[1]}" 409s 409s c1 = build(spec[0] for spec in value_specs) 409s c2 = build(spec[1] for spec in value_specs) 409s code = f"assert {c2}==snapshot({c1})" 409s 409s named_flags = ", ".join(flags) 409s 409s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 409s > s1 = source(code) 409s 409s tests/test_preserve_values.py:229: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s tests/conftest.py:158: in w 409s return Source(source=source).run() 409s tests/conftest.py:114: in run 409s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 409s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_225.py:9: in 409s assert {0: 3, 1: 8, 2: 4}==snapshot({0: 3, 2: 2+2}) 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 409s result[key] = yield from self.get_adapter( 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '4 ' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_225.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 3, 1: 8, 2: 4}==snapshot({0: 3, 2: 2+2}) 409s ------------------------------ Captured log call ------------------------------- 409s 409s ___________ test_generic [{0: 3, 2: 3} -> {0: 3, 1: 8, 2: 3} ] ____________ 409s 409s source = .w at 0xf2dee848> 409s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 409s 409s def test_generic(source, subtests): 409s for braces in ("[]", "()", "{}"): 409s for value_specs in itertools.product(stuff, repeat=3): 409s flags = set().union(*[e[3] for e in value_specs]) 409s all_flags = { 409s frozenset(x) - {""} 409s for x in itertools.combinations_with_replacement( 409s flags | {""}, len(flags) 409s ) 409s } 409s 409s def build(value_lists): 409s value_lists = list(value_lists) 409s 409s if braces == "{}": 409s values = [ 409s f"{i}: {value_list[0]}" 409s for i, value_list in enumerate(value_lists) 409s if value_list 409s ] 409s else: 409s values = [x for value_list in value_lists for x in value_list] 409s 409s code = ", ".join(values) 409s 409s comma = "" 409s if len(values) == 1 and braces == "()": 409s comma = "," 409s 409s return f"{braces[0]}{code}{comma}{braces[1]}" 409s 409s c1 = build(spec[0] for spec in value_specs) 409s c2 = build(spec[1] for spec in value_specs) 409s code = f"assert {c2}==snapshot({c1})" 409s 409s named_flags = ", ".join(flags) 409s 409s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 409s > s1 = source(code) 409s 409s tests/test_preserve_values.py:229: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s tests/conftest.py:158: in w 409s return Source(source=source).run() 409s tests/conftest.py:114: in run 409s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 409s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_226.py:9: in 409s assert {0: 3, 1: 8, 2: 3}==snapshot({0: 3, 2: 3}) 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign 409s self.context.file._value_to_code(k), 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 409s return self._token_to_code(value_to_token(value)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '1 ' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_226.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 3, 1: 8, 2: 3}==snapshot({0: 3, 2: 3}) 409s ------------------------------ Captured log call ------------------------------- 409s 409s ______ test_generic [{0: 3, 1: 2+2, 2: 5} -> {0: 3, 1: 4} ] _______ 409s 409s source = .w at 0xf2dee848> 409s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 409s 409s def test_generic(source, subtests): 409s for braces in ("[]", "()", "{}"): 409s for value_specs in itertools.product(stuff, repeat=3): 409s flags = set().union(*[e[3] for e in value_specs]) 409s all_flags = { 409s frozenset(x) - {""} 409s for x in itertools.combinations_with_replacement( 409s flags | {""}, len(flags) 409s ) 409s } 409s 409s def build(value_lists): 409s value_lists = list(value_lists) 409s 409s if braces == "{}": 409s values = [ 409s f"{i}: {value_list[0]}" 409s for i, value_list in enumerate(value_lists) 409s if value_list 409s ] 409s else: 409s values = [x for value_list in value_lists for x in value_list] 409s 409s code = ", ".join(values) 409s 409s comma = "" 409s if len(values) == 1 and braces == "()": 409s comma = "," 409s 409s return f"{braces[0]}{code}{comma}{braces[1]}" 409s 409s c1 = build(spec[0] for spec in value_specs) 409s c2 = build(spec[1] for spec in value_specs) 409s code = f"assert {c2}==snapshot({c1})" 409s 409s named_flags = ", ".join(flags) 409s 409s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 409s > s1 = source(code) 409s 409s tests/test_preserve_values.py:229: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s tests/conftest.py:158: in w 409s return Source(source=source).run() 409s tests/conftest.py:114: in run 409s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 409s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_227.py:9: in 409s assert {0: 3, 1: 4}==snapshot({0: 3, 1: 2+2, 2: 5}) 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 409s result[key] = yield from self.get_adapter( 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '4 ' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_227.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 3, 1: 4}==snapshot({0: 3, 1: 2+2, 2: 5}) 409s ------------------------------ Captured log call ------------------------------- 409s 409s ______ test_generic [{0: 3, 1: 2+2} -> {0: 3, 1: 4, 2: 8} ] _______ 409s 409s source = .w at 0xf2dee848> 409s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 409s 409s def test_generic(source, subtests): 409s for braces in ("[]", "()", "{}"): 409s for value_specs in itertools.product(stuff, repeat=3): 409s flags = set().union(*[e[3] for e in value_specs]) 409s all_flags = { 409s frozenset(x) - {""} 409s for x in itertools.combinations_with_replacement( 409s flags | {""}, len(flags) 409s ) 409s } 409s 409s def build(value_lists): 409s value_lists = list(value_lists) 409s 409s if braces == "{}": 409s values = [ 409s f"{i}: {value_list[0]}" 409s for i, value_list in enumerate(value_lists) 409s if value_list 409s ] 409s else: 409s values = [x for value_list in value_lists for x in value_list] 409s 409s code = ", ".join(values) 409s 409s comma = "" 409s if len(values) == 1 and braces == "()": 409s comma = "," 409s 409s return f"{braces[0]}{code}{comma}{braces[1]}" 409s 409s c1 = build(spec[0] for spec in value_specs) 409s c2 = build(spec[1] for spec in value_specs) 409s code = f"assert {c2}==snapshot({c1})" 409s 409s named_flags = ", ".join(flags) 409s 409s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 409s > s1 = source(code) 409s 409s tests/test_preserve_values.py:229: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s tests/conftest.py:158: in w 409s return Source(source=source).run() 409s tests/conftest.py:114: in run 409s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 409s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_228.py:9: in 409s assert {0: 3, 1: 4, 2: 8}==snapshot({0: 3, 1: 2+2}) 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 409s result[key] = yield from self.get_adapter( 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '4 ' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_228.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 3, 1: 4, 2: 8}==snapshot({0: 3, 1: 2+2}) 409s ------------------------------ Captured log call ------------------------------- 409s 409s _____ test_generic [{0: 3, 1: 2+2, 2: 2+2} -> {0: 3, 1: 4, 2: 4} ] _____ 409s 409s source = .w at 0xf2dee848> 409s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 409s 409s def test_generic(source, subtests): 409s for braces in ("[]", "()", "{}"): 409s for value_specs in itertools.product(stuff, repeat=3): 409s flags = set().union(*[e[3] for e in value_specs]) 409s all_flags = { 409s frozenset(x) - {""} 409s for x in itertools.combinations_with_replacement( 409s flags | {""}, len(flags) 409s ) 409s } 409s 409s def build(value_lists): 409s value_lists = list(value_lists) 409s 409s if braces == "{}": 409s values = [ 409s f"{i}: {value_list[0]}" 409s for i, value_list in enumerate(value_lists) 409s if value_list 409s ] 409s else: 409s values = [x for value_list in value_lists for x in value_list] 409s 409s code = ", ".join(values) 409s 409s comma = "" 409s if len(values) == 1 and braces == "()": 409s comma = "," 409s 409s return f"{braces[0]}{code}{comma}{braces[1]}" 409s 409s c1 = build(spec[0] for spec in value_specs) 409s c2 = build(spec[1] for spec in value_specs) 409s code = f"assert {c2}==snapshot({c1})" 409s 409s named_flags = ", ".join(flags) 409s 409s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 409s > s1 = source(code) 409s 409s tests/test_preserve_values.py:229: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s tests/conftest.py:158: in w 409s return Source(source=source).run() 409s tests/conftest.py:114: in run 409s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 409s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_229.py:9: in 409s assert {0: 3, 1: 4, 2: 4}==snapshot({0: 3, 1: 2+2, 2: 2+2}) 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 409s result[key] = yield from self.get_adapter( 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '4 ' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_229.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 3, 1: 4, 2: 4}==snapshot({0: 3, 1: 2+2, 2: 2+2}) 409s ------------------------------ Captured log call ------------------------------- 409s 409s ______ test_generic [{0: 3, 1: 2+2, 2: 3} -> {0: 3, 1: 4, 2: 3} ] ______ 409s 409s source = .w at 0xf2dee848> 409s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 409s 409s def test_generic(source, subtests): 409s for braces in ("[]", "()", "{}"): 409s for value_specs in itertools.product(stuff, repeat=3): 409s flags = set().union(*[e[3] for e in value_specs]) 409s all_flags = { 409s frozenset(x) - {""} 409s for x in itertools.combinations_with_replacement( 409s flags | {""}, len(flags) 409s ) 409s } 409s 409s def build(value_lists): 409s value_lists = list(value_lists) 409s 409s if braces == "{}": 409s values = [ 409s f"{i}: {value_list[0]}" 409s for i, value_list in enumerate(value_lists) 409s if value_list 409s ] 409s else: 409s values = [x for value_list in value_lists for x in value_list] 409s 409s code = ", ".join(values) 409s 409s comma = "" 409s if len(values) == 1 and braces == "()": 409s comma = "," 409s 409s return f"{braces[0]}{code}{comma}{braces[1]}" 409s 409s c1 = build(spec[0] for spec in value_specs) 409s c2 = build(spec[1] for spec in value_specs) 409s code = f"assert {c2}==snapshot({c1})" 409s 409s named_flags = ", ".join(flags) 409s 409s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 409s > s1 = source(code) 409s 409s tests/test_preserve_values.py:229: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s tests/conftest.py:158: in w 409s return Source(source=source).run() 409s tests/conftest.py:114: in run 409s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 409s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_230.py:9: in 409s assert {0: 3, 1: 4, 2: 3}==snapshot({0: 3, 1: 2+2, 2: 3}) 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 409s result[key] = yield from self.get_adapter( 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '4 ' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_230.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 3, 1: 4, 2: 3}==snapshot({0: 3, 1: 2+2, 2: 3}) 409s ------------------------------ Captured log call ------------------------------- 409s 409s ___________ test_generic [{0: 3, 1: 3, 2: 5} -> {0: 3, 1: 3} ] ____________ 409s 409s source = .w at 0xf2dee848> 409s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 409s 409s def test_generic(source, subtests): 409s for braces in ("[]", "()", "{}"): 409s for value_specs in itertools.product(stuff, repeat=3): 409s flags = set().union(*[e[3] for e in value_specs]) 409s all_flags = { 409s frozenset(x) - {""} 409s for x in itertools.combinations_with_replacement( 409s flags | {""}, len(flags) 409s ) 409s } 409s 409s def build(value_lists): 409s value_lists = list(value_lists) 409s 409s if braces == "{}": 409s values = [ 409s f"{i}: {value_list[0]}" 409s for i, value_list in enumerate(value_lists) 409s if value_list 409s ] 409s else: 409s values = [x for value_list in value_lists for x in value_list] 409s 409s code = ", ".join(values) 409s 409s comma = "" 409s if len(values) == 1 and braces == "()": 409s comma = "," 409s 409s return f"{braces[0]}{code}{comma}{braces[1]}" 409s 409s c1 = build(spec[0] for spec in value_specs) 409s c2 = build(spec[1] for spec in value_specs) 409s code = f"assert {c2}==snapshot({c1})" 409s 409s named_flags = ", ".join(flags) 409s 409s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 409s s1 = source(code) 409s print("source:", code) 409s 409s assert set(s1.flags) == flags 409s 409s assert ("fix" in flags) == s1.error 409s 409s for f in all_flags: 409s c3 = build( 409s [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] 409s ) 409s new_code = f"assert {c2}==snapshot({c3})" 409s 409s print(f"{set(f)}:") 409s print(" ", code) 409s print(" ", new_code) 409s > s2 = s1.run(*f) 409s 409s tests/test_preserve_values.py:245: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s tests/conftest.py:137: in run 409s recorder.fix_all() 409s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 409s file.rewrite() 409s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 409s new_code = self.new_code() 409s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 409s format_whole_file = enforce_formatting() or code == format_code( 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s 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})' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_233.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 409s reported_flags: {'fix'} 409s run: pytest --inline-snapshot= 409s output: 409s |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 409s source: assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 409s set(): 409s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 409s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 409s reported_flags: {'fix'} 409s run: pytest --inline-snapshot= 409s output: 409s |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 409s {'fix'}: 409s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 409s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3}) 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 409s ----------------------------- Captured stderr call ----------------------------- 409s Traceback (most recent call last): 409s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 409s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 409s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_231.py", line 9, in 409s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 409s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 409s AssertionError 409s Traceback (most recent call last): 409s File "/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py", line 114, in run 409s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 409s File "/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_232.py", line 9, in 409s assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) 409s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 409s AssertionError 409s ------------------------------ Captured log call ------------------------------- 409s 409s ___________ test_generic [{0: 3, 1: 3} -> {0: 3, 1: 3, 2: 8} ] ____________ 409s 409s source = .w at 0xf2dee848> 409s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 409s 409s def test_generic(source, subtests): 409s for braces in ("[]", "()", "{}"): 409s for value_specs in itertools.product(stuff, repeat=3): 409s flags = set().union(*[e[3] for e in value_specs]) 409s all_flags = { 409s frozenset(x) - {""} 409s for x in itertools.combinations_with_replacement( 409s flags | {""}, len(flags) 409s ) 409s } 409s 409s def build(value_lists): 409s value_lists = list(value_lists) 409s 409s if braces == "{}": 409s values = [ 409s f"{i}: {value_list[0]}" 409s for i, value_list in enumerate(value_lists) 409s if value_list 409s ] 409s else: 409s values = [x for value_list in value_lists for x in value_list] 409s 409s code = ", ".join(values) 409s 409s comma = "" 409s if len(values) == 1 and braces == "()": 409s comma = "," 409s 409s return f"{braces[0]}{code}{comma}{braces[1]}" 409s 409s c1 = build(spec[0] for spec in value_specs) 409s c2 = build(spec[1] for spec in value_specs) 409s code = f"assert {c2}==snapshot({c1})" 409s 409s named_flags = ", ".join(flags) 409s 409s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 409s > s1 = source(code) 409s 409s tests/test_preserve_values.py:229: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s tests/conftest.py:158: in w 409s return Source(source=source).run() 409s tests/conftest.py:114: in run 409s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 409s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_234.py:9: in 409s assert {0: 3, 1: 3, 2: 8}==snapshot({0: 3, 1: 3}) 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign 409s self.context.file._value_to_code(k), 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code 409s return self._token_to_code(value_to_token(value)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '2 ' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_234.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 3, 1: 3, 2: 8}==snapshot({0: 3, 1: 3}) 409s ------------------------------ Captured log call ------------------------------- 409s 409s ______ test_generic [{0: 3, 1: 3, 2: 2+2} -> {0: 3, 1: 3, 2: 4} ] ______ 409s 409s source = .w at 0xf2dee848> 409s subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0xf5909948>, suspend_capture_ctx= _capture_fixture=None>>, request=>) 409s 409s def test_generic(source, subtests): 409s for braces in ("[]", "()", "{}"): 409s for value_specs in itertools.product(stuff, repeat=3): 409s flags = set().union(*[e[3] for e in value_specs]) 409s all_flags = { 409s frozenset(x) - {""} 409s for x in itertools.combinations_with_replacement( 409s flags | {""}, len(flags) 409s ) 409s } 409s 409s def build(value_lists): 409s value_lists = list(value_lists) 409s 409s if braces == "{}": 409s values = [ 409s f"{i}: {value_list[0]}" 409s for i, value_list in enumerate(value_lists) 409s if value_list 409s ] 409s else: 409s values = [x for value_list in value_lists for x in value_list] 409s 409s code = ", ".join(values) 409s 409s comma = "" 409s if len(values) == 1 and braces == "()": 409s comma = "," 409s 409s return f"{braces[0]}{code}{comma}{braces[1]}" 409s 409s c1 = build(spec[0] for spec in value_specs) 409s c2 = build(spec[1] for spec in value_specs) 409s code = f"assert {c2}==snapshot({c1})" 409s 409s named_flags = ", ".join(flags) 409s 409s with subtests.test(f"{c1} -> {c2} <{named_flags}>"): 409s > s1 = source(code) 409s 409s tests/test_preserve_values.py:229: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s tests/conftest.py:158: in w 409s return Source(source=source).run() 409s tests/conftest.py:114: in run 409s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 409s /tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_235.py:9: in 409s assert {0: 3, 1: 3, 2: 4}==snapshot({0: 3, 1: 3, 2: 2+2}) 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign 409s result[key] = yield from self.get_adapter( 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '4 ' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_generic0/test_235.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert {0: 3, 1: 3, 2: 4}==snapshot({0: 3, 1: 3, 2: 2+2}) 409s ------------------------------ Captured log call ------------------------------- 409s 409s ________________________ test_pydantic_create_snapshot _________________________ 409s 409s def test_pydantic_create_snapshot(): 409s 409s Example( 409s """ 409s from pydantic import BaseModel 409s from inline_snapshot import snapshot 409s 409s class M(BaseModel): 409s size:int 409s name:str 409s age:int=4 409s 409s def test_pydantic(): 409s m=M(size=5,name="Tom") 409s assert m==snapshot() 409s assert m.dict()==snapshot() 409s 409s """ 409s > ).run_pytest( 409s ["--inline-snapshot=create"], 409s changed_files=snapshot( 409s { 409s "test_something.py": """\ 409s 409s from pydantic import BaseModel 409s from inline_snapshot import snapshot 409s 409s class M(BaseModel): 409s size:int 409s name:str 409s age:int=4 409s 409s def test_pydantic(): 409s m=M(size=5,name="Tom") 409s assert m==snapshot(M(size=5, name="Tom")) 409s assert m.dict()==snapshot({"size": 5, "name": "Tom", "age": 4}) 409s 409s \ 409s """ 409s } 409s ), 409s ).run_pytest( 409s ["--inline-snapshot=disable"] 409s ) 409s 409s tests/test_pydantic.py:23: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s self = 409s args = ['--inline-snapshot=create'] 409s 409s def run_pytest( 409s self, 409s args: list[str] = [], 409s *, 409s term_columns=80, 409s env: dict[str, str] = {}, 409s changed_files: Snapshot[dict[str, str]] | None = None, 409s report: Snapshot[str] | None = None, 409s stderr: Snapshot[str] | None = None, 409s returncode: Snapshot[int] | None = None, 409s ) -> Example: 409s """Run pytest with the given args and env variables in an seperate 409s process. 409s 409s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 409s 409s Parameters: 409s args: pytest arguments like "--inline-snapshot=fix" 409s env: dict of environment variables 409s changed_files: snapshot of files which are changed by this run. 409s report: snapshot of the report at the end of the pytest run. 409s stderr: pytest stderr output 409s returncode: snapshot of the pytest returncode. 409s 409s Returns: 409s A new Example instance which contains the changed files. 409s """ 409s 409s with TemporaryDirectory() as dir: 409s tmp_path = Path(dir) 409s self._write_files(tmp_path) 409s 409s cmd = [sys.executable, "-m", "pytest", *args] 409s 409s command_env = dict(os.environ) 409s command_env["TERM"] = "unknown" 409s command_env["COLUMNS"] = str( 409s term_columns + 1 if platform.system() == "Windows" else term_columns 409s ) 409s command_env.pop("CI", None) 409s 409s command_env.update(env) 409s 409s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 409s 409s print("run>", *cmd) 409s print("stdout:") 409s print(result.stdout.decode()) 409s print("stderr:") 409s print(result.stderr.decode()) 409s 409s if returncode is not None: 409s assert result.returncode == returncode 409s 409s if stderr is not None: 409s assert result.stderr.decode() == stderr 409s 409s if report is not None: 409s 409s report_list = [] 409s record = False 409s for line in result.stdout.decode().splitlines(): 409s line = line.strip() 409s if line.startswith("===="): 409s record = False 409s 409s if record and line: 409s report_list.append(line) 409s 409s if line.startswith("====") and "inline snapshot" in line: 409s record = True 409s 409s report_str = "\n".join(report_list) 409s 409s assert normalize(report_str) == report, repr(report_str) 409s 409s if changed_files is not None: 409s current_files = {} 409s 409s for name, content in sorted(self._read_files(tmp_path).items()): 409s if name not in self.files or self.files[name] != content: 409s current_files[name] = content 409s > assert changed_files == current_files 409s E AssertionError: assert {'test_someth... 4})\n\n '} == {} 409s E 409s E Left contains 1 more item: 409s E {'test_something.py': '\n' 409s E 'from pydantic import BaseModel\n' 409s E 'from inline_snapshot import snapshot\n' 409s E '\n' 409s E 'class M(BaseModel):\n'... 409s E 409s E ...Full output truncated (12 lines hidden), use '-vv' to show 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 409s ----------------------------- Captured stdout call ----------------------------- 409s file: test_something.py 409s 409s from pydantic import BaseModel 409s from inline_snapshot import snapshot 409s 409s class M(BaseModel): 409s size:int 409s name:str 409s age:int=4 409s 409s def test_pydantic(): 409s m=M(size=5,name="Tom") 409s assert m==snapshot() 409s assert m.dict()==snapshot() 409s 409s 409s 409s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 409s stdout: 409s ============================= test session starts ============================== 409s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 409s rootdir: /tmp/tmpkce4hm02 409s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 409s collected 1 item 409s 409s test_something.py F [100%] 409s 409s =================================== FAILURES =================================== 409s ________________________________ test_pydantic _________________________________ 409s 409s def test_pydantic(): 409s m=M(size=5,name="Tom") 409s > assert m==snapshot() 409s 409s test_something.py:12: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '', filename = PosixPath('/tmp/tmpkce4hm02/test_something.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s =============================== inline snapshot ================================ 409s =========================== short test summary info ============================ 409s FAILED test_something.py::test_pydantic - TypeError: CliRunner.__init__() got... 409s ============================== 1 failed in 0.31s =============================== 409s 409s stderr: 409s 409s ___________________________ test_pydantic_field_repr ___________________________ 409s 409s def test_pydantic_field_repr(): 409s 409s Example( 409s """\ 409s from inline_snapshot import snapshot 409s from pydantic import BaseModel,Field 409s 409s class container(BaseModel): 409s a: int 409s b: int = Field(default=5,repr=False) 409s 409s assert container(a=1,b=5) == snapshot() 409s """ 409s > ).run_pytest( 409s ["--inline-snapshot=create"], 409s changed_files=snapshot( 409s { 409s "test_something.py": """\ 409s from inline_snapshot import snapshot 409s from pydantic import BaseModel,Field 409s 409s class container(BaseModel): 409s a: int 409s b: int = Field(default=5,repr=False) 409s 409s assert container(a=1,b=5) == snapshot(container(a=1)) 409s """ 409s } 409s ), 409s ).run_pytest( 409s ["--inline-snapshot=disable"] 409s ) 409s 409s tests/test_pydantic.py:64: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s self = 409s args = ['--inline-snapshot=create'] 409s 409s def run_pytest( 409s self, 409s args: list[str] = [], 409s *, 409s term_columns=80, 409s env: dict[str, str] = {}, 409s changed_files: Snapshot[dict[str, str]] | None = None, 409s report: Snapshot[str] | None = None, 409s stderr: Snapshot[str] | None = None, 409s returncode: Snapshot[int] | None = None, 409s ) -> Example: 409s """Run pytest with the given args and env variables in an seperate 409s process. 409s 409s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 409s 409s Parameters: 409s args: pytest arguments like "--inline-snapshot=fix" 409s env: dict of environment variables 409s changed_files: snapshot of files which are changed by this run. 409s report: snapshot of the report at the end of the pytest run. 409s stderr: pytest stderr output 409s returncode: snapshot of the pytest returncode. 409s 409s Returns: 409s A new Example instance which contains the changed files. 409s """ 409s 409s with TemporaryDirectory() as dir: 409s tmp_path = Path(dir) 409s self._write_files(tmp_path) 409s 409s cmd = [sys.executable, "-m", "pytest", *args] 409s 409s command_env = dict(os.environ) 409s command_env["TERM"] = "unknown" 409s command_env["COLUMNS"] = str( 409s term_columns + 1 if platform.system() == "Windows" else term_columns 409s ) 409s command_env.pop("CI", None) 409s 409s command_env.update(env) 409s 409s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 409s 409s print("run>", *cmd) 409s print("stdout:") 409s print(result.stdout.decode()) 409s print("stderr:") 409s print(result.stderr.decode()) 409s 409s if returncode is not None: 409s assert result.returncode == returncode 409s 409s if stderr is not None: 409s assert result.stderr.decode() == stderr 409s 409s if report is not None: 409s 409s report_list = [] 409s record = False 409s for line in result.stdout.decode().splitlines(): 409s line = line.strip() 409s if line.startswith("===="): 409s record = False 409s 409s if record and line: 409s report_list.append(line) 409s 409s if line.startswith("====") and "inline snapshot" in line: 409s record = True 409s 409s report_str = "\n".join(report_list) 409s 409s assert normalize(report_str) == report, repr(report_str) 409s 409s if changed_files is not None: 409s current_files = {} 409s 409s for name, content in sorted(self._read_files(tmp_path).items()): 409s if name not in self.files or self.files[name] != content: 409s current_files[name] = content 409s > assert changed_files == current_files 409s E AssertionError: assert {'test_someth...iner(a=1))\n'} == {} 409s E 409s E Left contains 1 more item: 409s E {'test_something.py': 'from inline_snapshot import snapshot\n' 409s E 'from pydantic import BaseModel,Field\n' 409s E '\n' 409s E 'class container(BaseModel):\n' 409s E ' a: int\n'... 409s E 409s E ...Full output truncated (4 lines hidden), use '-vv' to show 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 409s ----------------------------- Captured stdout call ----------------------------- 409s file: test_something.py 409s from inline_snapshot import snapshot 409s from pydantic import BaseModel,Field 409s 409s class container(BaseModel): 409s a: int 409s b: int = Field(default=5,repr=False) 409s 409s assert container(a=1,b=5) == snapshot() 409s 409s 409s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create 409s stdout: 409s ============================= test session starts ============================== 409s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 409s rootdir: /tmp/tmpjk66v2b8 409s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 409s collected 0 items / 1 error 409s 409s ==================================== ERRORS ==================================== 409s ______________________ ERROR collecting test_something.py ______________________ 409s test_something.py:8: in 409s assert container(a=1,b=5) == snapshot() 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 409s runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s =============================== inline snapshot ================================ 409s =========================== short test summary info ============================ 409s ERROR test_something.py - TypeError: CliRunner.__init__() got an unexpected k... 409s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 409s =============================== 1 error in 0.39s =============================== 409s 409s stderr: 409s 409s _________________________ test_pydantic_default_value __________________________ 409s 409s def test_pydantic_default_value(): 409s Example( 409s """\ 409s from inline_snapshot import snapshot,Is 409s from dataclasses import dataclass,field 409s from pydantic import BaseModel,Field 409s 409s class A(BaseModel): 409s a:int 409s b:int=2 409s c:list=Field(default_factory=list) 409s 409s def test_something(): 409s assert A(a=1) == snapshot(A(a=1,b=2,c=[])) 409s """ 409s > ).run_pytest( 409s ["--inline-snapshot=update"], 409s changed_files=snapshot( 409s { 409s "test_something.py": """\ 409s from inline_snapshot import snapshot,Is 409s from dataclasses import dataclass,field 409s from pydantic import BaseModel,Field 409s 409s class A(BaseModel): 409s a:int 409s b:int=2 409s c:list=Field(default_factory=list) 409s 409s def test_something(): 409s assert A(a=1) == snapshot(A(a=1)) 409s """ 409s } 409s ), 409s ) 409s 409s tests/test_pydantic.py:100: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s self = 409s args = ['--inline-snapshot=update'] 409s 409s def run_pytest( 409s self, 409s args: list[str] = [], 409s *, 409s term_columns=80, 409s env: dict[str, str] = {}, 409s changed_files: Snapshot[dict[str, str]] | None = None, 409s report: Snapshot[str] | None = None, 409s stderr: Snapshot[str] | None = None, 409s returncode: Snapshot[int] | None = None, 409s ) -> Example: 409s """Run pytest with the given args and env variables in an seperate 409s process. 409s 409s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 409s 409s Parameters: 409s args: pytest arguments like "--inline-snapshot=fix" 409s env: dict of environment variables 409s changed_files: snapshot of files which are changed by this run. 409s report: snapshot of the report at the end of the pytest run. 409s stderr: pytest stderr output 409s returncode: snapshot of the pytest returncode. 409s 409s Returns: 409s A new Example instance which contains the changed files. 409s """ 409s 409s with TemporaryDirectory() as dir: 409s tmp_path = Path(dir) 409s self._write_files(tmp_path) 409s 409s cmd = [sys.executable, "-m", "pytest", *args] 409s 409s command_env = dict(os.environ) 409s command_env["TERM"] = "unknown" 409s command_env["COLUMNS"] = str( 409s term_columns + 1 if platform.system() == "Windows" else term_columns 409s ) 409s command_env.pop("CI", None) 409s 409s command_env.update(env) 409s 409s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 409s 409s print("run>", *cmd) 409s print("stdout:") 409s print(result.stdout.decode()) 409s print("stderr:") 409s print(result.stderr.decode()) 409s 409s if returncode is not None: 409s assert result.returncode == returncode 409s 409s if stderr is not None: 409s assert result.stderr.decode() == stderr 409s 409s if report is not None: 409s 409s report_list = [] 409s record = False 409s for line in result.stdout.decode().splitlines(): 409s line = line.strip() 409s if line.startswith("===="): 409s record = False 409s 409s if record and line: 409s report_list.append(line) 409s 409s if line.startswith("====") and "inline snapshot" in line: 409s record = True 409s 409s report_str = "\n".join(report_list) 409s 409s assert normalize(report_str) == report, repr(report_str) 409s 409s if changed_files is not None: 409s current_files = {} 409s 409s for name, content in sorted(self._read_files(tmp_path).items()): 409s if name not in self.files or self.files[name] != content: 409s current_files[name] = content 409s > assert changed_files == current_files 409s E AssertionError: assert {'test_someth...ot(A(a=1))\n'} == {} 409s E 409s E Left contains 1 more item: 409s E {'test_something.py': 'from inline_snapshot import snapshot,Is\n' 409s E 'from dataclasses import dataclass,field\n' 409s E 'from pydantic import BaseModel,Field\n' 409s E '\n' 409s E 'class A(BaseModel):\n'... 409s E 409s E ...Full output truncated (7 lines hidden), use '-vv' to show 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 409s ----------------------------- Captured stdout call ----------------------------- 409s file: test_something.py 409s from inline_snapshot import snapshot,Is 409s from dataclasses import dataclass,field 409s from pydantic import BaseModel,Field 409s 409s class A(BaseModel): 409s a:int 409s b:int=2 409s c:list=Field(default_factory=list) 409s 409s def test_something(): 409s assert A(a=1) == snapshot(A(a=1,b=2,c=[])) 409s 409s 409s run> /usr/bin/python3.12 -m pytest --inline-snapshot=update 409s stdout: 409s ============================= test session starts ============================== 409s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 409s rootdir: /tmp/tmpzg0_1664 409s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 409s collected 1 item 409s 409s test_something.py . [100%] 409s =============================== inline snapshot ================================ 409s ─────────────────────────────── Update snapshots ─────────────────────────────── 409s 409s stderr: 409s Traceback (most recent call last): 409s File "", line 198, in _run_module_as_main 409s File "", line 88, in _run_code 409s File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in 409s raise SystemExit(pytest.console_main()) 409s ^^^^^^^^^^^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 409s code = main() 409s ^^^^^^ 409s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 409s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 409s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 409s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 409s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 409s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 409s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 409s raise exception.with_traceback(exception.__traceback__) 409s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 409s res = hook_impl.function(*args) 409s ^^^^^^^^^^^^^^^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 409s return wrap_session(config, _main) 409s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 409s config.hook.pytest_sessionfinish( 409s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 409s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 409s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 409s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 409s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 409s raise exception.with_traceback(exception.__traceback__) 409s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 409s teardown.throw(exception) # type: ignore[union-attr] 409s ^^^^^^^^^^^^^^^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 409s return (yield) 409s ^^^^^ 409s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 409s teardown.send(result) # type: ignore[union-attr] 409s ^^^^^^^^^^^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 409s self.config.hook.pytest_terminal_summary( 409s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 409s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 409s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 409s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 409s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 409s raise exception.with_traceback(exception.__traceback__) 409s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 409s teardown.throw(exception) # type: ignore[union-attr] 409s ^^^^^^^^^^^^^^^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 409s return (yield) 409s ^^^^^ 409s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 409s teardown.throw(exception) # type: ignore[union-attr] 409s ^^^^^^^^^^^^^^^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 409s return (yield) 409s ^^^^^ 409s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 409s res = hook_impl.function(*args) 409s ^^^^^^^^^^^^^^^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary 409s diff = file.diff() 409s ^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff 409s unified_diff(self.source.splitlines(), self.new_code().splitlines()), 409s ^^^^^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code 409s format_whole_file = enforce_formatting() or code == format_code( 409s ^^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 409s runner = CliRunner(mix_stderr=False) 409s ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 409s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s _________________________ test_pydantic_factory_method _________________________ 409s 409s def test_pydantic_factory_method(): 409s Example( 409s """\ 409s from inline_snapshot import snapshot 409s from pydantic import BaseModel 409s 409s class A(BaseModel): 409s a:int 409s 409s @classmethod 409s def from_str(cls,s): 409s return cls(a=int(s)) 409s 409s def test_something(): 409s for a in [1,2]: 409s assert A(a=2) == snapshot(A.from_str("1")) 409s """ 409s > ).run_pytest( 409s ["--inline-snapshot=fix"], 409s changed_files=snapshot( 409s { 409s "test_something.py": """\ 409s from inline_snapshot import snapshot 409s from pydantic import BaseModel 409s 409s class A(BaseModel): 409s a:int 409s 409s @classmethod 409s def from_str(cls,s): 409s return cls(a=int(s)) 409s 409s def test_something(): 409s for a in [1,2]: 409s assert A(a=2) == snapshot(A(a=2)) 409s """ 409s } 409s ), 409s ) 409s 409s tests/test_pydantic.py:157: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s self = 409s args = ['--inline-snapshot=fix'] 409s 409s def run_pytest( 409s self, 409s args: list[str] = [], 409s *, 409s term_columns=80, 409s env: dict[str, str] = {}, 409s changed_files: Snapshot[dict[str, str]] | None = None, 409s report: Snapshot[str] | None = None, 409s stderr: Snapshot[str] | None = None, 409s returncode: Snapshot[int] | None = None, 409s ) -> Example: 409s """Run pytest with the given args and env variables in an seperate 409s process. 409s 409s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 409s 409s Parameters: 409s args: pytest arguments like "--inline-snapshot=fix" 409s env: dict of environment variables 409s changed_files: snapshot of files which are changed by this run. 409s report: snapshot of the report at the end of the pytest run. 409s stderr: pytest stderr output 409s returncode: snapshot of the pytest returncode. 409s 409s Returns: 409s A new Example instance which contains the changed files. 409s """ 409s 409s with TemporaryDirectory() as dir: 409s tmp_path = Path(dir) 409s self._write_files(tmp_path) 409s 409s cmd = [sys.executable, "-m", "pytest", *args] 409s 409s command_env = dict(os.environ) 409s command_env["TERM"] = "unknown" 409s command_env["COLUMNS"] = str( 409s term_columns + 1 if platform.system() == "Windows" else term_columns 409s ) 409s command_env.pop("CI", None) 409s 409s command_env.update(env) 409s 409s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 409s 409s print("run>", *cmd) 409s print("stdout:") 409s print(result.stdout.decode()) 409s print("stderr:") 409s print(result.stderr.decode()) 409s 409s if returncode is not None: 409s assert result.returncode == returncode 409s 409s if stderr is not None: 409s assert result.stderr.decode() == stderr 409s 409s if report is not None: 409s 409s report_list = [] 409s record = False 409s for line in result.stdout.decode().splitlines(): 409s line = line.strip() 409s if line.startswith("===="): 409s record = False 409s 409s if record and line: 409s report_list.append(line) 409s 409s if line.startswith("====") and "inline snapshot" in line: 409s record = True 409s 409s report_str = "\n".join(report_list) 409s 409s assert normalize(report_str) == report, repr(report_str) 409s 409s if changed_files is not None: 409s current_files = {} 409s 409s for name, content in sorted(self._read_files(tmp_path).items()): 409s if name not in self.files or self.files[name] != content: 409s current_files[name] = content 409s > assert changed_files == current_files 409s E AssertionError: assert {'test_someth...ot(A(a=2))\n'} == {} 409s E 409s E Left contains 1 more item: 409s E {'test_something.py': 'from inline_snapshot import snapshot\n' 409s E 'from pydantic import BaseModel\n' 409s E '\n' 409s E 'class A(BaseModel):\n' 409s E ' a:int\n'... 409s E 409s E ...Full output truncated (9 lines hidden), use '-vv' to show 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 409s ----------------------------- Captured stdout call ----------------------------- 409s file: test_something.py 409s from inline_snapshot import snapshot 409s from pydantic import BaseModel 409s 409s class A(BaseModel): 409s a:int 409s 409s @classmethod 409s def from_str(cls,s): 409s return cls(a=int(s)) 409s 409s def test_something(): 409s for a in [1,2]: 409s assert A(a=2) == snapshot(A.from_str("1")) 409s 409s 409s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 409s stdout: 409s ============================= test session starts ============================== 409s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 409s rootdir: /tmp/tmpkc28j5kk 409s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 409s collected 1 item 409s 409s test_something.py F [100%] 409s 409s =================================== FAILURES =================================== 409s ________________________________ test_something ________________________________ 409s 409s def test_something(): 409s for a in [1,2]: 409s > assert A(a=2) == snapshot(A.from_str("1")) 409s 409s test_something.py:13: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:107: in assign 409s result = yield from self.value_assign(old_value, old_node, new_value) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py:87: in value_assign 409s result = yield from adapter.assign(old_value, old_node, new_value) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = 'A (a =2 )', filename = PosixPath('/tmp/tmpkc28j5kk/test_something.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s =============================== inline snapshot ================================ 409s =========================== short test summary info ============================ 409s FAILED test_something.py::test_something - TypeError: CliRunner.__init__() go... 409s ============================== 1 failed in 0.32s =============================== 409s 409s stderr: 409s 409s __________________________________ test_pypy ___________________________________ 409s 409s @pytest.mark.no_rewriting 409s def test_pypy(): 409s report = ( 409s snapshot("INFO: inline-snapshot was disabled because pypy is not supported") 409s if sys.implementation.name == "pypy" 409s else snapshot( 409s """\ 409s -------------------------------- Fix snapshots --------------------------------- 409s +----------------------------- test_something.py ------------------------------+ 409s | @@ -1,6 +1,6 @@ | 409s | | 409s | from inline_snapshot import snapshot | 409s | | 409s | def test_example(): | 409s | - assert 1+1==snapshot(3) | 409s | + assert 1+1==snapshot(2) | 409s +------------------------------------------------------------------------------+ 409s These changes will be applied, because you used --inline-snapshot=fix\ 409s """ 409s ) 409s ) 409s 409s Example( 409s """\ 409s from inline_snapshot import snapshot 409s 409s def test_example(): 409s assert 1+1==snapshot(3) 409s 409s """ 409s > ).run_pytest(["--inline-snapshot=fix"], report=report).run_pytest( 409s ["--inline-snapshot=disable"], report="" 409s ) 409s 409s tests/test_pypy.py:38: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:319: in run_pytest 409s assert normalize(report_str) == report, repr(report_str) 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = "''" 409s filename = PosixPath('/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_pypy.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s file: test_something.py 409s from inline_snapshot import snapshot 409s 409s def test_example(): 409s assert 1+1==snapshot(3) 409s 409s 409s 409s run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix 409s stdout: 409s ============================= test session starts ============================== 409s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 409s rootdir: /tmp/tmpm5kqspyv 409s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 409s collected 1 item 409s 409s test_something.py F [100%] 409s 409s =================================== FAILURES =================================== 409s _________________________________ test_example _________________________________ 409s 409s def test_example(): 409s > assert 1+1==snapshot(3) 409s 409s test_something.py:4: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '2 ', filename = PosixPath('/tmp/tmpm5kqspyv/test_something.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s =============================== inline snapshot ================================ 409s =========================== short test summary info ============================ 409s FAILED test_something.py::test_example - TypeError: CliRunner.__init__() got ... 409s ============================== 1 failed in 0.25s =============================== 409s 409s stderr: 409s 409s _________________________________ test_create __________________________________ 409s 409s project = .Project object at 0xf27f9c30> 409s 409s def test_create(project): 409s project.setup( 409s """\ 409s def test_a(): 409s assert 5==snapshot() 409s """ 409s ) 409s 409s result = project.run() 409s 409s > result.assert_outcomes(errors=1, passed=1) 409s E AssertionError: assert {'errors': 1,...pped': 0, ...} == {'errors': 1,...pped': 0, ...} 409s E 409s E Omitting 4 identical items, use -vv to show 409s E Differing items: 409s E {'failed': 1} != {'failed': 0} 409s E {'passed': 0} != {'passed': 1} 409s E Use -v to get more diff 409s 409s /tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_pytest_plugin.py:24: AssertionError 409s ----------------------------- Captured stdout call ----------------------------- 409s write code: 409s # äöß 🐍 409s from inline_snapshot import snapshot 409s from inline_snapshot import outsource 409s 409s 409s def test_a(): 409s assert 5==snapshot() 409s 409s running: pytest 409s in: /tmp/pytest-of-ubuntu/pytest-0/test_create0 409s ============================= test session starts ============================== 409s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 409s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_create0 409s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 409s collected 1 item 409s 409s test_file.py FE [100%] 409s 409s ==================================== ERRORS ==================================== 409s _________________________ ERROR at teardown of test_a __________________________ 409s your snapshot is missing one value. 409s =================================== FAILURES =================================== 409s ____________________________________ test_a ____________________________________ 409s 409s def test_a(): 409s > assert 5==snapshot() 409s 409s test_file.py:7: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_create0/test_file.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s =============================== inline snapshot ================================ 409s =========================== short test summary info ============================ 409s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 409s ERROR test_file.py::test_a - Failed: your snapshot is missing one value. 409s ========================== 1 failed, 1 error in 0.32s ========================== 409s ___________________________________ test_fix ___________________________________ 409s 409s project = .Project object at 0xf27ec390> 409s 409s def test_fix(project): 409s project.setup( 409s """\ 409s def test_a(): 409s assert 5==snapshot(4) 409s """ 409s ) 409s 409s result = project.run() 409s 409s > result.assert_outcomes(failed=1, errors=1) 409s E AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 1,...pped': 0, ...} 409s E 409s E Omitting 5 identical items, use -vv to show 409s E Differing items: 409s E {'errors': 0} != {'errors': 1} 409s E Use -v to get more diff 409s 409s /tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_pytest_plugin.py:71: AssertionError 409s ----------------------------- Captured stdout call ----------------------------- 409s write code: 409s # äöß 🐍 409s from inline_snapshot import snapshot 409s from inline_snapshot import outsource 409s 409s 409s def test_a(): 409s assert 5==snapshot(4) 409s 409s running: pytest 409s in: /tmp/pytest-of-ubuntu/pytest-0/test_fix0 409s ============================= test session starts ============================== 409s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 409s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_fix0 409s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 409s collected 1 item 409s 409s test_file.py F [100%] 409s 409s =================================== FAILURES =================================== 409s ____________________________________ test_a ____________________________________ 409s 409s def test_a(): 409s > assert 5==snapshot(4) 409s 409s test_file.py:7: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '5 ' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_fix0/test_file.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s =============================== inline snapshot ================================ 409s =========================== short test summary info ============================ 409s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 409s ============================== 1 failed in 0.33s =============================== 409s _________________________________ test_update __________________________________ 409s 409s project = .Project object at 0xf27f9ed0> 409s 409s def test_update(project): 409s project.setup( 409s """\ 409s def test_a(): 409s assert "5" == snapshot('''5''') 409s """ 409s ) 409s 409s result = project.run() 409s 409s > result.assert_outcomes(passed=1) 409s E AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...} 409s E 409s E Omitting 4 identical items, use -vv to show 409s E Differing items: 409s E {'failed': 1} != {'failed': 0} 409s E {'passed': 0} != {'passed': 1} 409s E Use -v to get more diff 409s 409s /tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_pytest_plugin.py:118: AssertionError 409s ----------------------------- Captured stdout call ----------------------------- 409s write code: 409s # äöß 🐍 409s from inline_snapshot import snapshot 409s from inline_snapshot import outsource 409s 409s 409s def test_a(): 409s assert "5" == snapshot('''5''') 409s 409s running: pytest 409s in: /tmp/pytest-of-ubuntu/pytest-0/test_update0 409s ============================= test session starts ============================== 409s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 409s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_update0 409s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 409s collected 1 item 409s 409s test_file.py F [100%] 409s 409s =================================== FAILURES =================================== 409s ____________________________________ test_a ____________________________________ 409s 409s def test_a(): 409s > assert "5" == snapshot('''5''') 409s 409s test_file.py:7: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = "'5'" 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_update0/test_file.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s =============================== inline snapshot ================================ 409s =========================== short test summary info ============================ 409s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 409s ============================== 1 failed in 0.33s =============================== 409s __________________________________ test_trim ___________________________________ 409s 409s project = .Project object at 0xf27eccc0> 409s 409s def test_trim(project): 409s project.setup( 409s """\ 409s def test_a(): 409s assert 5 in snapshot([4,5]) 409s """ 409s ) 409s 409s result = project.run() 409s 409s result.assert_outcomes(passed=1) 409s 409s assert result.report == snapshot( 409s """\ 409s Info: one snapshot can be trimmed (--inline-snapshot=trim) 409s You can also use --inline-snapshot=review to approve the changes interactively 409s """ 409s ) 409s 409s result = project.run("--inline-snapshot=trim") 409s 409s > assert result.report == snapshot( 409s """\ 409s -------------------------------- Trim snapshots -------------------------------- 409s +-------------------------------- test_file.py --------------------------------+ 409s | @@ -4,4 +4,4 @@ | 409s | | 409s | | 409s | | 409s | def test_a(): | 409s | - assert 5 in snapshot([4,5]) | 409s | + assert 5 in snapshot([5]) | 409s +------------------------------------------------------------------------------+ 409s These changes will be applied, because you used --inline-snapshot=trim 409s """ 409s ) 409s 409s /tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_pytest_plugin.py:178: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = "'-------------------------------- Trim snapshots --------------------------------'" 409s filename = PosixPath('/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_pytest_plugin.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s write code: 409s # äöß 🐍 409s from inline_snapshot import snapshot 409s from inline_snapshot import outsource 409s 409s 409s def test_a(): 409s assert 5 in snapshot([4,5]) 409s 409s running: pytest 409s in: /tmp/pytest-of-ubuntu/pytest-0/test_trim0 409s ============================= test session starts ============================== 409s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 409s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_trim0 409s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 409s collected 1 item 409s 409s test_file.py . [100%] 409s =============================== inline snapshot ================================ 409s Info: one snapshot can be trimmed (--inline-snapshot=trim) 409s 409s You can also use --inline-snapshot=review to approve the changes interactively 409s 409s ============================== 1 passed in 0.22s =============================== 409s running: pytest --inline-snapshot=trim 409s in: /tmp/pytest-of-ubuntu/pytest-0/test_trim0 409s ============================= test session starts ============================== 409s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 409s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_trim0 409s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 409s collected 1 item 409s 409s test_file.py . [100%] 409s =============================== inline snapshot ================================ 409s ──────────────────────────────── Trim snapshots ──────────────────────────────── 409s ----------------------------- Captured stderr call ----------------------------- 409s Traceback (most recent call last): 409s File "/usr/bin/pytest", line 8, in 409s sys.exit(console_main()) 409s ~~~~~~~~~~~~^^ 409s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main 409s code = main() 409s File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main 409s ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) 409s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 409s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 409s ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 409s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 409s ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 409s raise exception.with_traceback(exception.__traceback__) 409s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 409s res = hook_impl.function(*args) 409s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main 409s return wrap_session(config, _main) 409s File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session 409s config.hook.pytest_sessionfinish( 409s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 409s session=session, exitstatus=session.exitstatus 409s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 409s ) 409s ^ 409s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 409s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 409s ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 409s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 409s ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 409s raise exception.with_traceback(exception.__traceback__) 409s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 409s teardown.throw(exception) # type: ignore[union-attr] 409s ~~~~~~~~~~~~~~^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish 409s return (yield) 409s ^^^^^ 409s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall 409s teardown.send(result) # type: ignore[union-attr] 409s ~~~~~~~~~~~~~^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish 409s self.config.hook.pytest_terminal_summary( 409s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 409s terminalreporter=self, exitstatus=exitstatus, config=self.config 409s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 409s ) 409s ^ 409s File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ 409s return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) 409s ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec 409s return self._inner_hookexec(hook_name, methods, kwargs, firstresult) 409s ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall 409s raise exception.with_traceback(exception.__traceback__) 409s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 409s teardown.throw(exception) # type: ignore[union-attr] 409s ~~~~~~~~~~~~~~^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary 409s return (yield) 409s ^^^^^ 409s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall 409s teardown.throw(exception) # type: ignore[union-attr] 409s ~~~~~~~~~~~~~~^^^^^^^^^^^ 409s File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary 409s return (yield) 409s ^^^^^ 409s File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall 409s res = hook_impl.function(*args) 409s File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary 409s diff = file.diff() 409s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff 409s unified_diff(self.source.splitlines(), self.new_code().splitlines()), 409s ~~~~~~~~~~~~~^^ 409s File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code 409s format_whole_file = enforce_formatting() or code == format_code( 409s ~~~~~~~~~~~^ 409s code, self.filename 409s ^^^^^^^^^^^^^^^^^^^ 409s ) 409s ^ 409s File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code 409s runner = CliRunner(mix_stderr=False) 409s TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s ________________________________ test_multiple _________________________________ 409s 409s project = .Project object at 0xf27f9c18> 409s 409s def test_multiple(project): 409s project.setup( 409s """\ 409s def test_a(): 409s assert "5" == snapshot('''5''') 409s assert 5 <= snapshot(8) 409s assert 5 == snapshot(4) 409s """ 409s ) 409s 409s result = project.run() 409s 409s > result.assert_outcomes(failed=1, errors=1) 409s E AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 1,...pped': 0, ...} 409s E 409s E Omitting 5 identical items, use -vv to show 409s E Differing items: 409s E {'errors': 0} != {'errors': 1} 409s E Use -v to get more diff 409s 409s /tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_pytest_plugin.py:214: AssertionError 409s ----------------------------- Captured stdout call ----------------------------- 409s write code: 409s # äöß 🐍 409s from inline_snapshot import snapshot 409s from inline_snapshot import outsource 409s 409s 409s def test_a(): 409s assert "5" == snapshot('''5''') 409s assert 5 <= snapshot(8) 409s assert 5 == snapshot(4) 409s 409s running: pytest 409s in: /tmp/pytest-of-ubuntu/pytest-0/test_multiple0 409s ============================= test session starts ============================== 409s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 409s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_multiple0 409s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 409s collected 1 item 409s 409s test_file.py F [100%] 409s 409s =================================== FAILURES =================================== 409s ____________________________________ test_a ____________________________________ 409s 409s def test_a(): 409s > assert "5" == snapshot('''5''') 409s 409s test_file.py:7: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = "'5'" 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_multiple0/test_file.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s =============================== inline snapshot ================================ 409s =========================== short test summary info ============================ 409s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 409s ============================== 1 failed in 0.31s =============================== 409s _____________________________ test_multiple_report _____________________________ 409s 409s project = .Project object at 0xf2765468> 409s 409s def test_multiple_report(project): 409s project.setup( 409s """\ 409s def test_a(): 409s assert "5" == snapshot('''5''') 409s assert 5 <= snapshot(8) 409s assert 5 == snapshot(4) 409s """ 409s ) 409s 409s result = project.run("--inline-snapshot=trim,report") 409s 409s > assert result.report == snapshot( 409s """\ 409s -------------------------------- Fix snapshots --------------------------------- 409s +-------------------------------- test_file.py --------------------------------+ 409s | @@ -6,4 +6,4 @@ | 409s | | 409s | def test_a(): | 409s | assert "5" == snapshot('''5''') | 409s | assert 5 <= snapshot(8) | 409s | - assert 5 == snapshot(4) | 409s | + assert 5 == snapshot(5) | 409s +------------------------------------------------------------------------------+ 409s These changes are not applied. 409s Use --inline-snapshot=fix to apply them, or use the interactive mode with 409s --inline-snapshot=review 409s -------------------------------- Trim snapshots -------------------------------- 409s +-------------------------------- test_file.py --------------------------------+ 409s | @@ -5,5 +5,5 @@ | 409s | | 409s | | 409s | def test_a(): | 409s | assert "5" == snapshot('''5''') | 409s | - assert 5 <= snapshot(8) | 409s | + assert 5 <= snapshot(5) | 409s | assert 5 == snapshot(4) | 409s +------------------------------------------------------------------------------+ 409s These changes will be applied, because you used --inline-snapshot=trim 409s ------------------------------- Update snapshots ------------------------------- 409s +-------------------------------- test_file.py --------------------------------+ 409s | @@ -4,6 +4,6 @@ | 409s | | 409s | | 409s | | 409s | def test_a(): | 409s | - assert "5" == snapshot('''5''') | 409s | + assert "5" == snapshot("5") | 409s | assert 5 <= snapshot(5) | 409s | assert 5 == snapshot(4) | 409s +------------------------------------------------------------------------------+ 409s These changes are not applied. 409s Use --inline-snapshot=update to apply them, or use the interactive mode with 409s --inline-snapshot=review 409s """ 409s ) 409s 409s /tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_pytest_plugin.py:307: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = "''" 409s filename = PosixPath('/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_pytest_plugin.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s write code: 409s # äöß 🐍 409s from inline_snapshot import snapshot 409s from inline_snapshot import outsource 409s 409s 409s def test_a(): 409s assert "5" == snapshot('''5''') 409s assert 5 <= snapshot(8) 409s assert 5 == snapshot(4) 409s 409s running: pytest --inline-snapshot=trim,report 409s in: /tmp/pytest-of-ubuntu/pytest-0/test_multiple_report0 409s ============================= test session starts ============================== 409s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 409s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_multiple_report0 409s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 409s collected 1 item 409s 409s test_file.py F [100%] 409s 409s =================================== FAILURES =================================== 409s ____________________________________ test_a ____________________________________ 409s 409s def test_a(): 409s > assert "5" == snapshot('''5''') 409s 409s test_file.py:7: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = "'5'" 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_multiple_report0/test_file.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s =============================== inline snapshot ================================ 409s =========================== short test summary info ============================ 409s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 409s ============================== 1 failed in 0.29s =============================== 409s ______________________________ test_black_config _______________________________ 409s 409s project = .Project object at 0xf2765ca8> 409s 409s def test_black_config(project): 409s project.setup( 409s """\ 409s def test_a(): 409s assert list(range(10)) == snapshot([]) 409s """ 409s ) 409s 409s > project.format() 409s 409s /tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_pytest_plugin.py:370: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/conftest.py:315: in format 409s format_code(self._filename.read_text("utf-8"), self._filename), "utf-8" 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import outsource\n\n\ndef test_a():\n assert list(range(10)) == snapshot([])\n' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_black_config0/test_file.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s write code: 409s # äöß 🐍 409s from inline_snapshot import snapshot 409s from inline_snapshot import outsource 409s 409s 409s def test_a(): 409s assert list(range(10)) == snapshot([]) 409s 409s ________________________________ test_disabled _________________________________ 409s 409s project = .Project object at 0xf27023a8> 409s 409s def test_disabled(project): 409s project.setup( 409s """\ 409s def test_a(): 409s assert 4==snapshot(5) 409s """ 409s ) 409s 409s result = project.run("--inline-snapshot=disable") 409s result.assert_outcomes(failed=1) 409s 409s result = project.run("--inline-snapshot=fix") 409s > assert project.source == snapshot( 409s """\ 409s def test_a(): 409s assert 4==snapshot(4) 409s """ 409s ) 409s 409s /tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_pytest_plugin.py:409: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '"""\\\ndef test_a():\n assert 4==snapshot(5)\n"""' 409s filename = PosixPath('/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_pytest_plugin.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s write code: 409s # äöß 🐍 409s from inline_snapshot import snapshot 409s from inline_snapshot import outsource 409s 409s 409s def test_a(): 409s assert 4==snapshot(5) 409s 409s running: pytest --inline-snapshot=disable 409s in: /tmp/pytest-of-ubuntu/pytest-0/test_disabled0 409s ============================= test session starts ============================== 409s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 409s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_disabled0 409s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 409s collected 1 item 409s 409s test_file.py F [100%] 409s 409s =================================== FAILURES =================================== 409s ____________________________________ test_a ____________________________________ 409s 409s def test_a(): 409s > assert 4==snapshot(5) 409s E assert 4 == 5 409s E + where 5 = snapshot(5) 409s 409s test_file.py:7: AssertionError 409s =========================== short test summary info ============================ 409s FAILED test_file.py::test_a - assert 4 == 5 409s ============================== 1 failed in 0.21s =============================== 409s running: pytest --inline-snapshot=fix 409s in: /tmp/pytest-of-ubuntu/pytest-0/test_disabled0 409s ============================= test session starts ============================== 409s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 409s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_disabled0 409s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 409s collected 1 item 409s 409s test_file.py F [100%] 409s 409s =================================== FAILURES =================================== 409s ____________________________________ test_a ____________________________________ 409s 409s def test_a(): 409s > assert 4==snapshot(5) 409s 409s test_file.py:7: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '4 ' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_disabled0/test_file.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s =============================== inline snapshot ================================ 409s =========================== short test summary info ============================ 409s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 409s ============================== 1 failed in 0.30s =============================== 409s _________________________________ test_compare _________________________________ 409s 409s project = .Project object at 0xf2765dc8> 409s 409s def test_compare(project): 409s project.setup( 409s """\ 409s def test_a(): 409s assert "a"==snapshot("b") 409s """ 409s ) 409s 409s result = project.run() 409s > assert result.errorLines() == snapshot( 409s """\ 409s > assert "a"==snapshot("b") 409s E AssertionError: assert 'a' == 'b' 409s E ⏎ 409s E - b 409s E + a 409s """ 409s ) 409s 409s /tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_pytest_plugin.py:429: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '"""\\\n> assert "a"==snapshot("b")\n> runner = CliRunner(mix_stderr=False)\nE TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\n"""' 409s filename = PosixPath('/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_pytest_plugin.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s write code: 409s # äöß 🐍 409s from inline_snapshot import snapshot 409s from inline_snapshot import outsource 409s 409s 409s def test_a(): 409s assert "a"==snapshot("b") 409s 409s running: pytest 409s in: /tmp/pytest-of-ubuntu/pytest-0/test_compare0 409s ============================= test session starts ============================== 409s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 409s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_compare0 409s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 409s collected 1 item 409s 409s test_file.py F [100%] 409s 409s =================================== FAILURES =================================== 409s ____________________________________ test_a ____________________________________ 409s 409s def test_a(): 409s > assert "a"==snapshot("b") 409s 409s test_file.py:7: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = "'a'" 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_compare0/test_file.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s =============================== inline snapshot ================================ 409s =========================== short test summary info ============================ 409s FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... 409s ============================== 1 failed in 0.31s =============================== 409s __________________________ test_assertion_error_loop ___________________________ 409s 409s project = .Project object at 0xf27866a8> 409s 409s def test_assertion_error_loop(project): 409s project.setup( 409s """\ 409s for e in (1, 2): 409s assert e == snapshot() 409s """ 409s ) 409s result = project.run() 409s > assert result.errorLines() == snapshot( 409s """\ 409s E assert 2 == 1 409s E + where 1 = snapshot() 409s """ 409s ) 409s 409s /tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_pytest_plugin.py:466: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '"E TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'"' 409s filename = PosixPath('/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_pytest_plugin.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s write code: 409s # äöß 🐍 409s from inline_snapshot import snapshot 409s from inline_snapshot import outsource 409s 409s 409s for e in (1, 2): 409s assert e == snapshot() 409s 409s running: pytest 409s in: /tmp/pytest-of-ubuntu/pytest-0/test_assertion_error_loop0 409s ============================= test session starts ============================== 409s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 409s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_assertion_error_loop0 409s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 409s collected 0 items / 1 error 409s 409s ==================================== ERRORS ==================================== 409s ________________________ ERROR collecting test_file.py _________________________ 409s test_file.py:7: in 409s assert e == snapshot() 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 409s runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s =============================== inline snapshot ================================ 409s =========================== short test summary info ============================ 409s ERROR test_file.py - TypeError: CliRunner.__init__() got an unexpected keywor... 409s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 409s =============================== 1 error in 0.29s =============================== 409s _____________________________ test_assertion_error _____________________________ 409s 409s project = .Project object at 0xf2724648> 409s 409s def test_assertion_error(project): 409s project.setup("assert 2 == snapshot(1)") 409s result = project.run() 409s > assert result.errorLines() == snapshot( 409s """\ 409s E assert 2 == 1 409s E + where 1 = snapshot(1) 409s """ 409s ) 409s 409s /tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_pytest_plugin.py:493: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '"E TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'"' 409s filename = PosixPath('/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_pytest_plugin.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s write code: 409s # äöß 🐍 409s from inline_snapshot import snapshot 409s from inline_snapshot import outsource 409s 409s 409s assert 2 == snapshot(1) 409s running: pytest 409s in: /tmp/pytest-of-ubuntu/pytest-0/test_assertion_error0 409s ============================= test session starts ============================== 409s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 409s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_assertion_error0 409s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 409s collected 0 items / 1 error 409s 409s ==================================== ERRORS ==================================== 409s ________________________ ERROR collecting test_file.py _________________________ 409s test_file.py:6: in 409s assert 2 == snapshot(1) 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code 409s runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s =============================== inline snapshot ================================ 409s =========================== short test summary info ============================ 409s ERROR test_file.py - TypeError: CliRunner.__init__() got an unexpected keywor... 409s !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! 409s =============================== 1 error in 0.30s =============================== 409s _______________________ test_pytest_inlinesnapshot_auto ________________________ 409s 409s project = .Project object at 0xf2710d38> 409s 409s def test_pytest_inlinesnapshot_auto(project): 409s project.setup( 409s """\ 409s def test_something(): 409s assert 2 == snapshot(1) 409s """ 409s ) 409s result = project.run("--inline-snapshot=review", stdin=b"y\n") 409s > assert result.errorLines() == snapshot("") 409s 409s /tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_pytest_plugin.py:526: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '"""\\\n> assert 2 == snapshot(1)\n> runner = CliRunner(mix_stderr=False)\nE TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\n"""' 409s filename = PosixPath('/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_pytest_plugin.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s write code: 409s # äöß 🐍 409s from inline_snapshot import snapshot 409s from inline_snapshot import outsource 409s 409s 409s def test_something(): 409s assert 2 == snapshot(1) 409s 409s running: pytest --inline-snapshot=review 409s in: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_inlinesnapshot_auto0 409s ============================= test session starts ============================== 409s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 409s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_pytest_inlinesnapshot_auto0 409s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 409s collected 1 item 409s 409s test_file.py F [100%] 409s 409s =================================== FAILURES =================================== 409s ________________________________ test_something ________________________________ 409s 409s def test_something(): 409s > assert 2 == snapshot(1) 409s 409s test_file.py:7: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '2 ' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_pytest_inlinesnapshot_auto0/test_file.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s =============================== inline snapshot ================================ 409s =========================== short test summary info ============================ 409s FAILED test_file.py::test_something - TypeError: CliRunner.__init__() got an ... 409s ============================== 1 failed in 0.31s =============================== 409s ________________________ test_persist_unknown_external _________________________ 409s 409s project = .Project object at 0xf2710b88> 409s 409s def test_persist_unknown_external(project): 409s project.setup( 409s """\ 409s from inline_snapshot import external, snapshot 409s 409s def test_sub_snapshot(): 409s external("123*.png") 409s assert 1==snapshot(2) 409s """ 409s ) 409s 409s result = project.run("--inline-snapshot=fix") 409s 409s > assert project.source == snapshot( 409s """\ 409s from inline_snapshot import external, snapshot 409s 409s def test_sub_snapshot(): 409s external("123*.png") 409s assert 1==snapshot(1) 409s """ 409s ) 409s 409s /tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_pytest_plugin.py:596: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '"""\\\nfrom inline_snapshot import external, snapshot\n\ndef test_sub_snapshot():\n external("123*.png")\n assert 1==snapshot(2)\n"""' 409s filename = PosixPath('/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_pytest_plugin.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s write code: 409s # äöß 🐍 409s from inline_snapshot import snapshot 409s from inline_snapshot import outsource 409s from inline_snapshot import external, snapshot 409s 409s def test_sub_snapshot(): 409s external("123*.png") 409s assert 1==snapshot(2) 409s 409s running: pytest --inline-snapshot=fix 409s in: /tmp/pytest-of-ubuntu/pytest-0/test_persist_unknown_external0 409s ============================= test session starts ============================== 409s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 409s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_persist_unknown_external0 409s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 409s collected 1 item 409s 409s test_file.py F [100%] 409s 409s =================================== FAILURES =================================== 409s ______________________________ test_sub_snapshot _______________________________ 409s 409s def test_sub_snapshot(): 409s external("123*.png") 409s > assert 1==snapshot(2) 409s 409s test_file.py:8: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '1 ' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_persist_unknown_external0/test_file.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s =============================== inline snapshot ================================ 409s =========================== short test summary info ============================ 409s FAILED test_file.py::test_sub_snapshot - TypeError: CliRunner.__init__() got ... 409s ============================== 1 failed in 0.31s =============================== 409s ___________________________ test_diff_multiple_files ___________________________ 409s 409s def test_diff_multiple_files(): 409s 409s Example( 409s { 409s "test_a.py": """ 409s from inline_snapshot import snapshot 409s 409s def test_a(): 409s assert 1==snapshot(2) 409s """, 409s "test_b.py": """ 409s from inline_snapshot import snapshot 409s 409s def test_b(): 409s assert 1==snapshot() 409s """, 409s } 409s > ).run_pytest( 409s ["--inline-snapshot=create,fix"], 409s changed_files=snapshot( 409s { 409s "test_b.py": """\ 409s 409s from inline_snapshot import snapshot 409s 409s def test_b(): 409s assert 1==snapshot(1) 409s \ 409s """, 409s "test_a.py": """\ 409s 409s from inline_snapshot import snapshot 409s 409s def test_a(): 409s assert 1==snapshot(1) 409s \ 409s """, 409s } 409s ), 409s report=snapshot( 409s """\ 409s ------------------------------- Create snapshots ------------------------------- 409s +--------------------------------- test_b.py ----------------------------------+ 409s | @@ -2,5 +2,5 @@ | 409s | | 409s | from inline_snapshot import snapshot | 409s | | 409s | def test_b(): | 409s | - assert 1==snapshot() | 409s | + assert 1==snapshot(1) | 409s +------------------------------------------------------------------------------+ 409s These changes will be applied, because you used --inline-snapshot=create 409s -------------------------------- Fix snapshots --------------------------------- 409s +--------------------------------- test_a.py ----------------------------------+ 409s | @@ -2,5 +2,5 @@ | 409s | | 409s | from inline_snapshot import snapshot | 409s | | 409s | def test_a(): | 409s | - assert 1==snapshot(2) | 409s | + assert 1==snapshot(1) | 409s +------------------------------------------------------------------------------+ 409s These changes will be applied, because you used --inline-snapshot=fix\ 409s """ 409s ), 409s ) 409s 409s tests/test_pytest_plugin.py:626: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:319: in run_pytest 409s assert normalize(report_str) == report, repr(report_str) 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = "''" 409s filename = PosixPath('/tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_pytest_plugin.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s file: test_a.py 409s 409s from inline_snapshot import snapshot 409s 409s def test_a(): 409s assert 1==snapshot(2) 409s 409s 409s file: test_b.py 409s 409s from inline_snapshot import snapshot 409s 409s def test_b(): 409s assert 1==snapshot() 409s 409s 409s run> /usr/bin/python3.12 -m pytest --inline-snapshot=create,fix 409s stdout: 409s ============================= test session starts ============================== 409s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 409s rootdir: /tmp/tmpvf2fcetz 409s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 409s collected 2 items 409s 409s test_a.py F [ 50%] 409s test_b.py F [100%] 409s 409s =================================== FAILURES =================================== 409s ____________________________________ test_a ____________________________________ 409s 409s def test_a(): 409s > assert 1==snapshot(2) 409s 409s test_a.py:5: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '1 ', filename = PosixPath('/tmp/tmpvf2fcetz/test_a.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ____________________________________ test_b ____________________________________ 409s 409s def test_b(): 409s > assert 1==snapshot() 409s 409s test_b.py:5: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '', filename = PosixPath('/tmp/tmpvf2fcetz/test_b.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s =============================== inline snapshot ================================ 409s =========================== short test summary info ============================ 409s FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... 409s FAILED test_b.py::test_b - TypeError: CliRunner.__init__() got an unexpected ... 409s ============================== 2 failed in 0.27s =============================== 409s 409s stderr: 409s 409s ___________________ test_storage_dir_config[tests/snapshots] ___________________ 409s 409s project = .Project object at 0xf2693468> 409s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config_tests_0') 409s storage_dir = 'tests/snapshots' 409s 409s @pytest.mark.parametrize("storage_dir", ["tests/snapshots", None]) 409s def test_storage_dir_config(project, tmp_path, storage_dir): 409s # Relative path case: `tests/snapshots` (parametrized). 409s # Absolute path case: `tmp_path / "snapshots"` (parametrized as `None`). 409s if not storage_dir: 409s storage_dir = tmp_path / "snapshots" 409s 409s project.pyproject( 409s f""" 409s [tool.inline-snapshot] 409s storage-dir = "{storage_dir}" 409s """ 409s ) 409s 409s project.setup( 409s """ 409s from inline_snapshot import outsource, snapshot 409s 409s def test_outsource(): 409s assert outsource("hello", suffix=".html") == snapshot() 409s """ 409s ) 409s 409s result = project.run("--inline-snapshot=create") 409s > assert result.ret == 0 409s E assert == 0 409s E + where = .ret 409s 409s /tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_pytest_plugin.py:754: AssertionError 409s ----------------------------- Captured stdout call ----------------------------- 409s write code: 409s # äöß 🐍 409s from inline_snapshot import snapshot 409s from inline_snapshot import outsource 409s 409s 409s 409s from inline_snapshot import outsource, snapshot 409s 409s def test_outsource(): 409s assert outsource("hello", suffix=".html") == snapshot() 409s 409s running: pytest --inline-snapshot=create 409s in: /tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config0 409s ============================= test session starts ============================== 409s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 409s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config0 409s configfile: pyproject.toml 409s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 409s collected 1 item 409s 409s test_file.py F [100%] 409s 409s =================================== FAILURES =================================== 409s ________________________________ test_outsource ________________________________ 409s 409s def test_outsource(): 409s > assert outsource("hello", suffix=".html") == snapshot() 409s 409s test_file.py:10: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config0/test_file.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s =============================== inline snapshot ================================ 409s =========================== short test summary info ============================ 409s FAILED test_file.py::test_outsource - TypeError: CliRunner.__init__() got an ... 409s ============================== 1 failed in 0.31s =============================== 409s ________________________ test_storage_dir_config[None] _________________________ 409s 409s project = .Project object at 0xf26a2528> 409s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config_None_0') 409s storage_dir = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config_None_0/snapshots') 409s 409s @pytest.mark.parametrize("storage_dir", ["tests/snapshots", None]) 409s def test_storage_dir_config(project, tmp_path, storage_dir): 409s # Relative path case: `tests/snapshots` (parametrized). 409s # Absolute path case: `tmp_path / "snapshots"` (parametrized as `None`). 409s if not storage_dir: 409s storage_dir = tmp_path / "snapshots" 409s 409s project.pyproject( 409s f""" 409s [tool.inline-snapshot] 409s storage-dir = "{storage_dir}" 409s """ 409s ) 409s 409s project.setup( 409s """ 409s from inline_snapshot import outsource, snapshot 409s 409s def test_outsource(): 409s assert outsource("hello", suffix=".html") == snapshot() 409s """ 409s ) 409s 409s result = project.run("--inline-snapshot=create") 409s > assert result.ret == 0 409s E assert == 0 409s E + where = .ret 409s 409s /tmp/autopkgtest.NQN92o/autopkgtest_tmp/tests/test_pytest_plugin.py:754: AssertionError 409s ----------------------------- Captured stdout call ----------------------------- 409s write code: 409s # äöß 🐍 409s from inline_snapshot import snapshot 409s from inline_snapshot import outsource 409s 409s 409s 409s from inline_snapshot import outsource, snapshot 409s 409s def test_outsource(): 409s assert outsource("hello", suffix=".html") == snapshot() 409s 409s running: pytest --inline-snapshot=create 409s in: /tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config1 409s ============================= test session starts ============================== 409s platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0 409s rootdir: /tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config1 409s configfile: pyproject.toml 409s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 409s collected 1 item 409s 409s test_file.py F [100%] 409s 409s =================================== FAILURES =================================== 409s ________________________________ test_outsource ________________________________ 409s 409s def test_outsource(): 409s > assert outsource("hello", suffix=".html") == snapshot() 409s 409s test_file.py:10: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_storage_dir_config1/test_file.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s =============================== inline snapshot ================================ 409s =========================== short test summary info ============================ 409s FAILED test_file.py::test_outsource - TypeError: CliRunner.__init__() got an ... 409s ============================== 1 failed in 0.30s =============================== 409s __________________ test_find_pyproject_in_parent_directories ___________________ 409s 409s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_find_pyproject_in_parent_0') 409s 409s def test_find_pyproject_in_parent_directories(tmp_path): 409s 409s Example( 409s { 409s "pyproject.toml": """\ 409s [tool.inline-snapshot] 409s hash-length=2 409s """, 409s "project/pytest.ini": "", 409s "project/test_something.py": """\ 409s from inline_snapshot import outsource,snapshot,external 409s 409s def test_something(): 409s assert outsource("test") == snapshot() 409s """, 409s } 409s > ).run_pytest( 409s ["--rootdir", "./project", "--inline-snapshot=create"], 409s changed_files=snapshot( 409s { 409s "project/test_something.py": """\ 409s from inline_snapshot import outsource,snapshot,external 409s 409s def test_something(): 409s assert outsource("test") == snapshot(external("9f*.txt")) 409s """ 409s } 409s ), 409s ) 409s 409s tests/test_pytest_plugin.py:790: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s self = 409s args = ['--rootdir', './project', '--inline-snapshot=create'] 409s 409s def run_pytest( 409s self, 409s args: list[str] = [], 409s *, 409s term_columns=80, 409s env: dict[str, str] = {}, 409s changed_files: Snapshot[dict[str, str]] | None = None, 409s report: Snapshot[str] | None = None, 409s stderr: Snapshot[str] | None = None, 409s returncode: Snapshot[int] | None = None, 409s ) -> Example: 409s """Run pytest with the given args and env variables in an seperate 409s process. 409s 409s It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` 409s 409s Parameters: 409s args: pytest arguments like "--inline-snapshot=fix" 409s env: dict of environment variables 409s changed_files: snapshot of files which are changed by this run. 409s report: snapshot of the report at the end of the pytest run. 409s stderr: pytest stderr output 409s returncode: snapshot of the pytest returncode. 409s 409s Returns: 409s A new Example instance which contains the changed files. 409s """ 409s 409s with TemporaryDirectory() as dir: 409s tmp_path = Path(dir) 409s self._write_files(tmp_path) 409s 409s cmd = [sys.executable, "-m", "pytest", *args] 409s 409s command_env = dict(os.environ) 409s command_env["TERM"] = "unknown" 409s command_env["COLUMNS"] = str( 409s term_columns + 1 if platform.system() == "Windows" else term_columns 409s ) 409s command_env.pop("CI", None) 409s 409s command_env.update(env) 409s 409s result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) 409s 409s print("run>", *cmd) 409s print("stdout:") 409s print(result.stdout.decode()) 409s print("stderr:") 409s print(result.stderr.decode()) 409s 409s if returncode is not None: 409s assert result.returncode == returncode 409s 409s if stderr is not None: 409s assert result.stderr.decode() == stderr 409s 409s if report is not None: 409s 409s report_list = [] 409s record = False 409s for line in result.stdout.decode().splitlines(): 409s line = line.strip() 409s if line.startswith("===="): 409s record = False 409s 409s if record and line: 409s report_list.append(line) 409s 409s if line.startswith("====") and "inline snapshot" in line: 409s record = True 409s 409s report_str = "\n".join(report_list) 409s 409s assert normalize(report_str) == report, repr(report_str) 409s 409s if changed_files is not None: 409s current_files = {} 409s 409s for name, content in sorted(self._read_files(tmp_path).items()): 409s if name not in self.files or self.files[name] != content: 409s current_files[name] = content 409s > assert changed_files == current_files 409s E assert {'project/tes...9f*.txt"))\n'} == {} 409s E 409s E Left contains 1 more item: 409s E {'project/test_something.py': 'from inline_snapshot import ' 409s E 'outsource,snapshot,external\n' 409s E '\n' 409s E 'def test_something():\n' 409s E ' assert outsource("test") == ' 409s E 'snapshot(external("9f*.txt"))\n'} 409s E Use -v to get more diff 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError 409s ----------------------------- Captured stdout call ----------------------------- 409s file: pyproject.toml 409s [tool.inline-snapshot] 409s hash-length=2 409s 409s 409s file: project/pytest.ini 409s 409s 409s file: project/test_something.py 409s from inline_snapshot import outsource,snapshot,external 409s 409s def test_something(): 409s assert outsource("test") == snapshot() 409s 409s 409s run> /usr/bin/python3.12 -m pytest --rootdir ./project --inline-snapshot=create 409s stdout: 409s ============================= test session starts ============================== 409s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 409s rootdir: /tmp/tmpgcxai5vd/project 409s configfile: ../pyproject.toml 409s plugins: typeguard-4.4.1, hypothesis-6.125.2, inline-snapshot-0.19.3, pytest_freezer-0.4.9, mock-3.14.0, subtests-0.13.1, time-machine-2.16.0 409s collected 1 item 409s 409s project/test_something.py F [100%] 409s 409s =================================== FAILURES =================================== 409s ________________________________ test_something ________________________________ 409s 409s def test_something(): 409s > assert outsource("test") == snapshot() 409s 409s project/test_something.py:4: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '', filename = PosixPath('/tmp/tmpgcxai5vd/project/test_something.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s =============================== inline snapshot ================================ 409s =========================== short test summary info ============================ 409s FAILED project/test_something.py::test_something - TypeError: CliRunner.__ini... 409s ============================== 1 failed in 0.26s =============================== 409s 409s stderr: 409s 409s _________________________________ test_rewrite _________________________________ 409s 409s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_rewrite0') 409s 409s def test_rewrite(tmp_path): 409s file = tmp_path / "file.txt" 409s file.write_text( 409s """ 409s 12345 409s 12345 409s 12345 409s """, 409s "utf-8", 409s ) 409s 409s with ChangeRecorder().activate() as recorder: 409s s = recorder.change_set() 409s 409s s.replace(((2, 2), (2, 3)), "a", filename=file) 409s s.delete(((3, 2), (3, 3)), filename=file) 409s s.insert((4, 2), "c", filename=file) 409s 409s assert recorder.num_fixes() == 1 409s > recorder.fix_all() 409s 409s tests/test_rewrite_code.py:43: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all 409s file.rewrite() 409s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite 409s new_code = self.new_code() 409s /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code 409s format_whole_file = enforce_formatting() or code == format_code( 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '\n12345\n12345\n12345\n' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_rewrite0/file.txt') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ______________________________ test_string_update ______________________________ 409s 409s check_update = .w at 0xf2685b68> 409s 409s def test_string_update(check_update): 409s # black --preview wraps strings to keep the line length. 409s # string concatenation should produce updates. 409s assert ( 409s check_update( 409s 'assert "ab" == snapshot("a" "b")', reported_flags="", flags="update" 409s ) 409s == 'assert "ab" == snapshot("a" "b")' 409s ) 409s 409s assert ( 409s check_update( 409s 'assert "ab" == snapshot("a"\n "b")', reported_flags="", flags="update" 409s ) 409s == 'assert "ab" == snapshot("a"\n "b")' 409s ) 409s 409s > assert check_update( 409s 'assert "ab\\nc" == snapshot("a"\n "b\\nc")', flags="update" 409s ) == snapshot( 409s '''\ 409s assert "ab\\nc" == snapshot("""\\ 409s ab 409s c\\ 409s """)\ 409s ''' 409s ) 409s 409s tests/test_string.py:26: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s tests/conftest.py:49: in w 409s s = source(source_code) 409s tests/conftest.py:158: in w 409s return Source(source=source).run() 409s tests/conftest.py:114: in run 409s exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) 409s /tmp/pytest-of-ubuntu/pytest-0/test_string_update0/test_5.py:9: in 409s assert "ab\nc" == snapshot("a" 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ 409s return self == other 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ 409s self._changes.append(next(it)) 409s /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign 409s new_code = self.context.file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '"""\\\nab\nc\\\n"""' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_string_update0/test_5.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert "ab" == snapshot("a" "b") 409s reported_flags: set() 409s run: pytest --inline-snapshot= 409s output: 409s |assert "ab" == snapshot("a" "b") 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert "ab" == snapshot("a" "b") 409s reported_flags: set() 409s run: pytest --inline-snapshot=update 409s output: 409s |assert "ab" == snapshot("a" "b") 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert "ab" == snapshot("a" 409s | "b") 409s reported_flags: set() 409s run: pytest --inline-snapshot= 409s output: 409s |assert "ab" == snapshot("a" 409s | "b") 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert "ab" == snapshot("a" 409s | "b") 409s reported_flags: set() 409s run: pytest --inline-snapshot=update 409s output: 409s |assert "ab" == snapshot("a" 409s | "b") 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |assert "ab\nc" == snapshot("a" 409s | "b\nc") 409s _____________________________ test_string_newline ______________________________ 409s 409s check_update = .w at 0xf266e438> 409s 409s def test_string_newline(check_update): 409s > assert check_update('s = snapshot("a\\nb")', flags="update") == snapshot( 409s '''\ 409s s = snapshot("""\\ 409s a 409s b\\ 409s """)\ 409s ''' 409s ) 409s 409s tests/test_string.py:46: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s tests/conftest.py:49: in w 409s s = source(source_code) 409s tests/conftest.py:158: in w 409s return Source(source=source).run() 409s tests/conftest.py:125: in run 409s changes += snapshot._changes() 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 409s yield from self._value._get_changes() 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:218: in _get_changes 409s yield from handle(self._ast_node, self._old_value) 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:206: in handle 409s new_code = self._file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '"""\\\na\nb\\\n"""' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_string_newline0/test_1.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |s = snapshot("a\nb") 409s ___________________________ test_string_quote_choice ___________________________ 409s 409s check_update = .w at 0xf2719d48> 409s 409s def test_string_quote_choice(check_update): 409s > assert check_update( 409s "s = snapshot(\" \\'\\'\\' \\'\\'\\' \\\"\\\"\\\"\\nother_line\")", 409s flags="update", 409s ) == snapshot( 409s '''\ 409s s = snapshot("""\\ 409s \'\'\' \'\'\' \\"\\"\\" 409s other_line\\ 409s """)\ 409s ''' 409s ) 409s 409s tests/test_string.py:115: 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s tests/conftest.py:49: in w 409s s = source(source_code) 409s tests/conftest.py:158: in w 409s return Source(source=source).run() 409s tests/conftest.py:125: in run 409s changes += snapshot._changes() 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes 409s yield from self._value._get_changes() 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:218: in _get_changes 409s yield from handle(self._ast_node, self._old_value) 409s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:206: in handle 409s new_code = self._file._token_to_code(new_token) 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code 409s return self._format(tokenize.untokenize(tokens)).strip() 409s /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format 409s return format_code(text, Path(self._source.filename)) 409s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 409s 409s text = '"""\\\n \'\'\' \'\'\' \\"\\"\\"\nother_line\\\n"""' 409s filename = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_string_quote_choice0/test_1.py') 409s 409s def format_code(text, filename): 409s if _config.config.format_command is not None: 409s format_command = _config.config.format_command.format(filename=filename) 409s result = sp.run( 409s format_command, shell=True, input=text.encode("utf-8"), capture_output=True 409s ) 409s if result.returncode != 0: 409s raise_problem( 409s f"""\ 409s [b]The format_command '{escape(format_command)}' caused the following error:[/b] 409s """ 409s + result.stdout.decode("utf-8") 409s + result.stderr.decode("utf-8") 409s ) 409s return text 409s return result.stdout.decode("utf-8") 409s 409s try: 409s from black import main 409s from click.testing import CliRunner 409s except ImportError: 409s raise_problem( 409s f"""\ 409s [b]inline-snapshot is not able to format your code.[/b] 409s This issue can be solved by: 409s * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions 409s * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). 409s """ 409s ) 409s return text 409s 409s with warnings.catch_warnings(): 409s warnings.simplefilter("ignore") 409s 409s > runner = CliRunner(mix_stderr=False) 409s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 409s 409s /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError 409s ----------------------------- Captured stdout call ----------------------------- 409s 409s input: 409s |""" 409s |PYTEST_DONT_REWRITE 409s |""" 409s |# äöß 🐍 409s |from inline_snapshot import snapshot 409s |from inline_snapshot import external 409s |from inline_snapshot import outsource 409s | 409s |s = snapshot(" \'\'\' \'\'\' \"\"\"\nother_line") 409s =============================== warnings summary =============================== 409s tests/adapter/test_sequence.py:64 409s /tmp/autopkgtest.NQN92o/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 409s @pytest.mark.no_rewriting 409s 409s tests/test_inline_snapshot.py:17 409s /tmp/autopkgtest.NQN92o/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 409s @pytest.mark.no_rewriting 409s 409s tests/test_inline_snapshot.py:24 409s /tmp/autopkgtest.NQN92o/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 409s @pytest.mark.no_rewriting 409s 409s tests/test_pypy.py:8 409s /tmp/autopkgtest.NQN92o/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 409s @pytest.mark.no_rewriting 409s 409s tests/test_pytest_plugin.py:275 409s /tmp/autopkgtest.NQN92o/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 409s @pytest.mark.no_rewriting 409s 409s tests/test_pytest_plugin.py:501 409s /tmp/autopkgtest.NQN92o/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 409s @pytest.mark.no_rewriting 409s 409s -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html 409s =============================== inline snapshot ================================ 409s Error: one snapshot has incorrect values (--inline-snapshot=fix) 409s 409s You can also use --inline-snapshot=review to approve the changes interactively 409s =========================== short test summary info ============================ 409s FAILED tests/adapter/test_dataclass.py::test_unmanaged - TypeError: CliRunner... 409s FAILED tests/adapter/test_dataclass.py::test_reeval - assert None == ('TypeEr... 409s FAILED tests/adapter/test_dataclass.py::test_dataclass_default_value - TypeEr... 409s FAILED tests/adapter/test_dataclass.py::test_attrs_default_value - AssertionE... 409s FAILED tests/adapter/test_dataclass.py::test_attrs_field_repr - AssertionErro... 409s FAILED tests/adapter/test_dataclass.py::test_disabled[executing] - TypeError:... 409s FAILED tests/adapter/test_dataclass.py::test_disabled[without-executing] - At... 409s FAILED tests/adapter/test_dataclass.py::test_add_argument - TypeError: CliRun... 409s FAILED tests/adapter/test_dataclass.py::test_remove_positional_argument - ass... 409s FAILED tests/adapter/test_dataclass.py::test_namedtuple - assert {'test_somet... 409s FAILED tests/adapter/test_dataclass.py::test_defaultdict - assert {'test_some... 409s FAILED tests/adapter/test_dataclass.py::test_dataclass_field_repr - assert No... 409s FAILED tests/adapter/test_dataclass.py::test_dataclass_var - assert None == (... 409s FAILED tests/adapter/test_dict.py::test_dict_var - assert None == ('TypeError... 409s FAILED tests/adapter/test_general.py::test_adapter_mismatch - assert None == ... 409s FAILED tests/adapter/test_sequence.py::test_list_adapter_create_inner_snapshot 409s FAILED tests/adapter/test_sequence.py::test_list_adapter_fix_inner_snapshot 409s FAILED tests/adapter/test_sequence.py::test_list_var - assert None == ('TypeE... 409s FAILED tests/test_change.py::test_change_function_args - TypeError: CliRunner... 409s FAILED tests/test_code_repr.py::test_enum - TypeError: CliRunner.__init__() g... 409s FAILED tests/test_code_repr.py::test_snapshot_generates_hasrepr - TypeError: ... 409s FAILED tests/test_code_repr.py::test_enum_in_dataclass - TypeError: CliRunner... 409s FAILED tests/test_code_repr.py::test_flag - TypeError: CliRunner.__init__() g... 409s FAILED tests/test_code_repr.py::test_type - TypeError: CliRunner.__init__() g... 409s FAILED tests/test_code_repr.py::test_qualname - assert None == ('TypeError:\n... 409s FAILED tests/test_code_repr.py::test_invalid_repr - TypeError: CliRunner.__in... 409s FAILED tests/test_config.py::test_config_pyproject - AssertionError: assert {... 409s FAILED tests/test_config.py::test_config_env - AssertionError: assert {'test_... 409s FAILED tests/test_config.py::test_shortcuts - AssertionError: assert {'test_a... 409s FAILED tests/test_config.py::test_default_shortcuts - AssertionError: assert ... 409s FAILED tests/test_dirty_equals.py::test_compare_dirty_equals_twice - assert N... 409s FAILED tests/test_dirty_equals.py::test_dirty_equals_with_changing_args - ass... 409s FAILED tests/test_example.py::test_example - AssertionError: assert [] == ['f... 409s FAILED tests/test_external.py::test_basic - TypeError: CliRunner.__init__() g... 409s FAILED tests/test_external.py::test_persist - TypeError: CliRunner.__init__()... 409s FAILED tests/test_external.py::test_pytest_compare_external - TypeError: CliR... 409s FAILED tests/test_external.py::test_pytest_compare_external_bytes - TypeError... 409s FAILED tests/test_external.py::test_pytest_existing_external_import - TypeErr... 409s FAILED tests/test_external.py::test_pytest_trim_external - TypeError: CliRunn... 409s FAILED tests/test_external.py::test_pytest_new_external - TypeError: CliRunne... 409s FAILED tests/test_external.py::test_pytest_config_hash_length - TypeError: Cl... 409s FAILED tests/test_external.py::test_no_imports - AssertionError: assert {'err... 409s FAILED tests/test_external.py::test_ensure_imports - TypeError: CliRunner.__i... 409s FAILED tests/test_external.py::test_ensure_imports_with_comment - TypeError: ... 409s FAILED tests/test_external.py::test_new_externals - TypeError: CliRunner.__in... 409s FAILED tests/test_formating.py::test_black_formatting_error - assert None == ... 409s FAILED tests/test_formating.py::test_fstring_139 - AssertionError: assert 1 == 0 409s [assert 4 == snapshot()] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 4 == snapshot({})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 4 == snapshot(5)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 4 == snapshot({0: 5})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 4 == snapshot(2+2)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 4 == snapshot({0: 2+2})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 4 <= snapshot()] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 4 <= snapshot({})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 4 <= snapshot(5)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 4 <= snapshot({0: 5})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 5 <= snapshot(4)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 5 <= snapshot({0: 4})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 5 <= snapshot(3+2)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 5 <= snapshot({0: 3+2})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 5 >= snapshot()] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 5 >= snapshot({})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 5 >= snapshot(4)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 5 >= snapshot({0: 4})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 4 >= snapshot(5)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 4 >= snapshot({0: 5})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 5 >= snapshot(3+2)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 5 >= snapshot({0: 3+2})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 5 in snapshot()] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 5 in snapshot({})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 5 in snapshot([4, 5])] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 5 in snapshot({0: [4, 5]})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 5 in snapshot([])] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 5 in snapshot({0: []})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 5 in snapshot([3+2])] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s [assert 5 in snapshot({0: [3+2]})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) fix(==)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) update(==)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) create(<=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) trim(<=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) fix(<=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) update(<=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) create(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) trim(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) fix(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) update(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) create(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) trim(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) fix(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) update(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) update(==)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) create(<=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) trim(<=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) fix(<=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) update(<=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) create(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) trim(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) fix(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) update(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) create(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) trim(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) fix(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) update(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) create(<=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) trim(<=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) fix(<=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) update(<=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) create(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) trim(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) fix(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) update(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) create(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) trim(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) fix(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) update(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) trim(<=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) fix(<=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) update(<=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) create(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) trim(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) fix(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) update(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) create(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) trim(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) fix(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) update(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) fix(<=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) update(<=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) create(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) trim(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) fix(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) update(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) create(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) trim(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) fix(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) update(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) update(<=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) create(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) trim(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) fix(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) update(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) create(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) trim(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) fix(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) update(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) create(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) trim(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) fix(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) update(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) create(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) trim(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) fix(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) update(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) trim(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) fix(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) update(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) create(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) trim(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) fix(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) update(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) fix(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) update(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) create(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) trim(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) fix(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) update(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) update(>=)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) create(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) trim(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) fix(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) update(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(>=) create(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(>=) trim(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(>=) fix(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(>=) update(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(in) trim(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(in) fix(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(in) update(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(in) fix(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(in) update(in)] 409s FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(in) update(in)] 409s FAILED tests/test_inline_snapshot.py::test_mutable_values - TypeError: CliRun... 409s FAILED tests/test_inline_snapshot.py::test_comparison - TypeError: CliRunner.... 409s FAILED tests/test_inline_snapshot.py::test_ge - TypeError: CliRunner.__init__... 409s FAILED tests/test_inline_snapshot.py::test_le - TypeError: CliRunner.__init__... 409s FAILED tests/test_inline_snapshot.py::test_contains - TypeError: CliRunner.__... 409s FAILED tests/test_inline_snapshot.py::test_getitem - TypeError: CliRunner.__i... 409s FAILED tests/test_inline_snapshot.py::test_assert - TypeError: CliRunner.__in... 409s FAILED tests/test_inline_snapshot.py::test_format_file - TypeError: CliRunner... 409s FAILED tests/test_inline_snapshot.py::test_format_value - TypeError: CliRunne... 409s FAILED tests/test_inline_snapshot.py::test_type_error - TypeError: CliRunner.... 409s FAILED tests/test_inline_snapshot.py::test_different_snapshot_name - TypeErro... 409s FAILED tests/test_inline_snapshot.py::test_quoting_change_is_no_update - Type... 409s FAILED tests/test_inline_snapshot.py::test_trailing_comma - TypeError: CliRun... 409s FAILED tests/test_inline_snapshot.py::test_is - assert None == ('TypeError:\n... 409s FAILED tests/test_is.py::test_missing_is - TypeError: CliRunner.__init__() go... 409s FAILED tests/test_is_normalized.py::test_repr - assert None == ('TypeError:\n... 409s FAILED tests/test_preserve_values.py::test_fix_list_fix - TypeError: CliRunne... 409s FAILED tests/test_preserve_values.py::test_fix_list_insert - TypeError: CliRu... 409s FAILED tests/test_preserve_values.py::test_fix_list_delete - TypeError: CliRu... 409s FAILED tests/test_preserve_values.py::test_fix_tuple_delete - TypeError: CliR... 409s FAILED tests/test_preserve_values.py::test_fix_dict_change - TypeError: CliRu... 409s FAILED tests/test_preserve_values.py::test_fix_dict_remove - TypeError: CliRu... 409s FAILED tests/test_preserve_values.py::test_fix_dict_insert - TypeError: CliRu... 409s FAILED tests/test_preserve_values.py::test_fix_dict_with_non_literal_keys - T... 409s FAILED tests/test_preserve_values.py::test_no_update_for_dirty_equals - TypeE... 409s FAILED tests/test_preserve_values.py::test_preserve_case_from_original_mr - T... 409s [[5, 5, 5] -> [] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[5, 5] -> [8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 409s [[5, 5, 2+2] -> [4] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[5, 5, 3] -> [3] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[5, 5] -> [8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 409s [[5] -> [8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 409s [[5, 2+2] -> [8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[5, 3] -> [8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[5, 2+2, 5] -> [4] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[5, 2+2] -> [4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[5, 2+2, 2+2] -> [4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[5, 2+2, 3] -> [4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[5, 3, 5] -> [3] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[5, 3] -> [3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[5, 3, 2+2] -> [3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[5, 3, 3] -> [3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[5, 5] -> [8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 409s [[5] -> [8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 409s [[5, 2+2] -> [8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[5, 3] -> [8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[5] -> [8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... 409s [[] -> [8, 8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[2+2] -> [8, 8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[3] -> [8, 8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[2+2, 5] -> [8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[2+2] -> [8, 4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[2+2, 2+2] -> [8, 4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[2+2, 3] -> [8, 4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[3, 5] -> [8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[3] -> [8, 3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[3, 2+2] -> [8, 3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[3, 3] -> [8, 3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[2+2, 5, 5] -> [4] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[2+2, 5] -> [4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[2+2, 5, 2+2] -> [4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[2+2, 5, 3] -> [4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[2+2, 5] -> [4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[2+2] -> [4, 8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[2+2, 2+2] -> [4, 8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[2+2, 3] -> [4, 8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[2+2, 2+2, 5] -> [4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[2+2, 2+2] -> [4, 4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[2+2, 2+2, 2+2] -> [4, 4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[2+2, 2+2, 3] -> [4, 4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[2+2, 3, 5] -> [4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[2+2, 3] -> [4, 3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[2+2, 3, 2+2] -> [4, 3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[2+2, 3, 3] -> [4, 3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[3, 5, 5] -> [3] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[3, 5] -> [3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[3, 5, 2+2] -> [3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[3, 5, 3] -> [3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[3, 5] -> [3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[3] -> [3, 8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[3, 2+2] -> [3, 8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[3, 3] -> [3, 8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[3, 2+2, 5] -> [3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[3, 2+2] -> [3, 4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[3, 2+2, 2+2] -> [3, 4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[3, 2+2, 3] -> [3, 4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[3, 3, 5] -> [3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[3, 3] -> [3, 3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [[3, 3, 2+2] -> [3, 3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(5, 5, 5) -> () ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(5, 5) -> (8,) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 409s [(5, 5, 2+2) -> (4,) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(5, 5, 3) -> (3,) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(5, 5) -> (8,) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 409s [(5,) -> (8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 409s [(5, 2+2) -> (8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(5, 3) -> (8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(5, 2+2, 5) -> (4,) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(5, 2+2) -> (4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(5, 2+2, 2+2) -> (4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(5, 2+2, 3) -> (4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(5, 3, 5) -> (3,) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(5, 3) -> (3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(5, 3, 2+2) -> (3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(5, 3, 3) -> (3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(5, 5) -> (8,) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 409s [(5,) -> (8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 409s [(5, 2+2) -> (8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(5, 3) -> (8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(5,) -> (8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... 409s [() -> (8, 8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(2+2,) -> (8, 8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(3,) -> (8, 8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(2+2, 5) -> (8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(2+2,) -> (8, 4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(2+2, 2+2) -> (8, 4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(2+2, 3) -> (8, 4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(3, 5) -> (8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(3,) -> (8, 3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(3, 2+2) -> (8, 3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(3, 3) -> (8, 3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(2+2, 5, 5) -> (4,) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(2+2, 5) -> (4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(2+2, 5, 2+2) -> (4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(2+2, 5, 3) -> (4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(2+2, 5) -> (4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(2+2,) -> (4, 8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(2+2, 2+2) -> (4, 8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(2+2, 3) -> (4, 8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(2+2, 2+2, 5) -> (4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(2+2, 2+2) -> (4, 4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(2+2, 2+2, 2+2) -> (4, 4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(2+2, 2+2, 3) -> (4, 4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(2+2, 3, 5) -> (4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(2+2, 3) -> (4, 3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(2+2, 3, 2+2) -> (4, 3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(2+2, 3, 3) -> (4, 3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(3, 5, 5) -> (3,) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(3, 5) -> (3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(3, 5, 2+2) -> (3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(3, 5, 3) -> (3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(3, 5) -> (3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(3,) -> (3, 8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(3, 2+2) -> (3, 8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(3, 3) -> (3, 8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(3, 2+2, 5) -> (3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(3, 2+2) -> (3, 4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(3, 2+2, 2+2) -> (3, 4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(3, 2+2, 3) -> (3, 4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(3, 3, 5) -> (3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(3, 3) -> (3, 3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [(3, 3, 2+2) -> (3, 3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 5, 1: 5, 2: 5} -> {} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 5, 1: 5} -> {2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 5, 1: 5, 2: 2+2} -> {2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 5, 1: 5, 2: 3} -> {2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 5, 2: 5} -> {1: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 5} -> {1: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 5, 2: 2+2} -> {1: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 5, 2: 3} -> {1: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 5, 1: 2+2, 2: 5} -> {1: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 5, 1: 2+2} -> {1: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 5, 1: 2+2, 2: 2+2} -> {1: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 5, 1: 2+2, 2: 3} -> {1: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 5, 1: 3, 2: 5} -> {1: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 5, 1: 3} -> {1: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 5, 1: 3, 2: 2+2} -> {1: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 5, 1: 3, 2: 3} -> {1: 3, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{1: 5, 2: 5} -> {0: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{1: 5} -> {0: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{1: 5, 2: 2+2} -> {0: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{1: 5, 2: 3} -> {0: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{2: 5} -> {0: 8, 1: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{} -> {0: 8, 1: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{2: 2+2} -> {0: 8, 1: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{2: 3} -> {0: 8, 1: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{1: 2+2, 2: 5} -> {0: 8, 1: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{1: 2+2} -> {0: 8, 1: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{1: 2+2, 2: 2+2} -> {0: 8, 1: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{1: 2+2, 2: 3} -> {0: 8, 1: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{1: 3, 2: 5} -> {0: 8, 1: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{1: 3} -> {0: 8, 1: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{1: 3, 2: 2+2} -> {0: 8, 1: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{1: 3, 2: 3} -> {0: 8, 1: 3, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 2+2, 1: 5, 2: 5} -> {0: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 2+2, 1: 5} -> {0: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 2+2, 1: 5, 2: 2+2} -> {0: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 2+2, 1: 5, 2: 3} -> {0: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 2+2, 2: 5} -> {0: 4, 1: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 2+2} -> {0: 4, 1: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 2+2, 2: 2+2} -> {0: 4, 1: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 2+2, 2: 3} -> {0: 4, 1: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 2+2, 1: 2+2, 2: 5} -> {0: 4, 1: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 2+2, 1: 2+2} -> {0: 4, 1: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 2+2, 1: 2+2, 2: 2+2} -> {0: 4, 1: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 2+2, 1: 2+2, 2: 3} -> {0: 4, 1: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 2+2, 1: 3, 2: 5} -> {0: 4, 1: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 2+2, 1: 3} -> {0: 4, 1: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 2+2, 1: 3, 2: 2+2} -> {0: 4, 1: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 2+2, 1: 3, 2: 3} -> {0: 4, 1: 3, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 3, 1: 5, 2: 5} -> {0: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 3, 1: 5} -> {0: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 3, 1: 5, 2: 2+2} -> {0: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 3, 1: 5, 2: 3} -> {0: 3, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 3, 2: 5} -> {0: 3, 1: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 3} -> {0: 3, 1: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 3, 2: 2+2} -> {0: 3, 1: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 3, 2: 3} -> {0: 3, 1: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 3, 1: 2+2, 2: 5} -> {0: 3, 1: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 3, 1: 2+2} -> {0: 3, 1: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 3, 1: 2+2, 2: 2+2} -> {0: 3, 1: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 3, 1: 2+2, 2: 3} -> {0: 3, 1: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 3, 1: 3, 2: 5} -> {0: 3, 1: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 3, 1: 3} -> {0: 3, 1: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s [{0: 3, 1: 3, 2: 2+2} -> {0: 3, 1: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic 409s FAILED tests/test_pydantic.py::test_pydantic_create_snapshot - AssertionError... 409s FAILED tests/test_pydantic.py::test_pydantic_field_repr - AssertionError: ass... 409s FAILED tests/test_pydantic.py::test_pydantic_default_value - AssertionError: ... 409s FAILED tests/test_pydantic.py::test_pydantic_factory_method - AssertionError:... 409s FAILED tests/test_pypy.py::test_pypy - TypeError: CliRunner.__init__() got an... 409s FAILED tests/test_pytest_plugin.py::test_create - AssertionError: assert {'er... 409s FAILED tests/test_pytest_plugin.py::test_fix - AssertionError: assert {'error... 409s FAILED tests/test_pytest_plugin.py::test_update - AssertionError: assert {'er... 409s FAILED tests/test_pytest_plugin.py::test_trim - TypeError: CliRunner.__init__... 409s FAILED tests/test_pytest_plugin.py::test_multiple - AssertionError: assert {'... 409s FAILED tests/test_pytest_plugin.py::test_multiple_report - TypeError: CliRunn... 409s FAILED tests/test_pytest_plugin.py::test_black_config - TypeError: CliRunner.... 409s FAILED tests/test_pytest_plugin.py::test_disabled - TypeError: CliRunner.__in... 409s FAILED tests/test_pytest_plugin.py::test_compare - TypeError: CliRunner.__ini... 409s FAILED tests/test_pytest_plugin.py::test_assertion_error_loop - TypeError: Cl... 409s FAILED tests/test_pytest_plugin.py::test_assertion_error - TypeError: CliRunn... 409s FAILED tests/test_pytest_plugin.py::test_pytest_inlinesnapshot_auto - TypeErr... 409s FAILED tests/test_pytest_plugin.py::test_persist_unknown_external - TypeError... 409s FAILED tests/test_pytest_plugin.py::test_diff_multiple_files - TypeError: Cli... 409s FAILED tests/test_pytest_plugin.py::test_storage_dir_config[tests/snapshots] 409s 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 718s autopkgtest [19:40:01]: test autodep8-python3: [----------------------- 720s Testing with python3.12: 720s 721s Testing with python3.13: 721s 721s autopkgtest [19:40:04]: test autodep8-python3: -----------------------] 726s autopkgtest [19:40:09]: test autodep8-python3: - - - - - - - - - - results - - - - - - - - - - 726s autodep8-python3 PASS (superficial) 731s autopkgtest [19:40:14]: @@@@@@@@@@@@@@@@@@@@ summary 731s upstream-tests FAIL non-zero exit status 1 731s autodep8-python3 PASS (superficial)